From 80f6d55836963f4e85c297f2901161d0ff69b4cb Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Fri, 24 Aug 2001 20:35:45 +0000 Subject: [PATCH] Eliminate improper consts and allow standard version to override. --- include/libbb.h | 2 +- libbb/dirname.c | 8 ++++++-- libbb/libbb.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/libbb.h b/include/libbb.h index a7e38325b..30f0bb9a7 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -259,7 +259,7 @@ extern FILE *gz_open(FILE *compressed_file, int *pid); extern struct hostent *xgethostbyname(const char *name); extern int create_icmp_socket(void); -char *dirname (const char *path); +char *dirname (char *path); int make_directory (char *path, long mode, int flags); diff --git a/libbb/dirname.c b/libbb/dirname.c index 87db1f24f..df9a49daa 100644 --- a/libbb/dirname.c +++ b/libbb/dirname.c @@ -22,12 +22,14 @@ #include #include "libbb.h" +#if defined __UCLIBC__ || __GNU_LIBRARY___ < 5 + /* Return a string containing the path name of the parent * directory of PATH. */ -char *dirname(const char *path) +char *dirname(char *path) { - const char *s; + char *s; /* Go to the end of the string. */ s = path + strlen(path) - 1; @@ -49,3 +51,5 @@ char *dirname(const char *path) s[1] = '\0'; return path; } + +#endif diff --git a/libbb/libbb.h b/libbb/libbb.h index a7e38325b..30f0bb9a7 100644 --- a/libbb/libbb.h +++ b/libbb/libbb.h @@ -259,7 +259,7 @@ extern FILE *gz_open(FILE *compressed_file, int *pid); extern struct hostent *xgethostbyname(const char *name); extern int create_icmp_socket(void); -char *dirname (const char *path); +char *dirname (char *path); int make_directory (char *path, long mode, int flags);