aboutsummaryrefslogtreecommitdiff
path: root/libbb/dirname.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/dirname.c')
-rw-r--r--libbb/dirname.c8
1 files changed, 6 insertions, 2 deletions
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 @@
22#include <string.h> 22#include <string.h>
23#include "libbb.h" 23#include "libbb.h"
24 24
25#if defined __UCLIBC__ || __GNU_LIBRARY___ < 5
26
25/* Return a string containing the path name of the parent 27/* Return a string containing the path name of the parent
26 * directory of PATH. */ 28 * directory of PATH. */
27 29
28char *dirname(const char *path) 30char *dirname(char *path)
29{ 31{
30 const char *s; 32 char *s;
31 33
32 /* Go to the end of the string. */ 34 /* Go to the end of the string. */
33 s = path + strlen(path) - 1; 35 s = path + strlen(path) - 1;
@@ -49,3 +51,5 @@ char *dirname(const char *path)
49 s[1] = '\0'; 51 s[1] = '\0';
50 return path; 52 return path;
51} 53}
54
55#endif