diff options
author | Jim Meyering <jim@meyering.net> | 2000-12-08 07:55:05 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-12-08 07:55:05 +0000 |
commit | 1f47a082c4fdaa45377b122a0fdcf7dd607c96cf (patch) | |
tree | 7187934665f74dfb2d737c12907d77eec754e0ec /src/dirname.c | |
parent | 7b55b7aa13f9cf5d5c949d53c93dd225afb6b2b5 (diff) | |
download | coreutils-1f47a082c4fdaa45377b122a0fdcf7dd607c96cf.tar.xz |
Include xalloc.h.
(main): Use dir_name rather than the underlying dir_name_r.
The former now handles cwd-relative names with drive-letter prefixes.
Diffstat (limited to 'src/dirname.c')
-rw-r--r-- | src/dirname.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dirname.c b/src/dirname.c index be1fc4559..58c2013d1 100644 --- a/src/dirname.c +++ b/src/dirname.c @@ -26,6 +26,7 @@ #include "error.h" #include "dirname.h" #include "closeout.h" +#include "xalloc.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "dirname" @@ -92,9 +93,11 @@ main (int argc, char **argv) usage (1); } - len = dir_name_r (argv[1], &result); - fwrite (result, 1, len, stdout); - putchar ('\n'); + result = dir_name (argv[1]); + if (result == NULL) + xalloc_die (); + puts (result); + free (result); exit (0); } |