diff options
| author | 2014-10-22 14:44:16 +0100 | |
|---|---|---|
| committer | 2014-10-22 14:44:27 +0100 | |
| commit | 577e0284a11f675b7b9845da7e3a8006905b4fcf (patch) | |
| tree | 881db58f98a568abd9d25cb920f8f16e92f53ce6 | |
| parent | ef7082b69181fa4857486e473ef67b04b1186be1 (diff) | |
| download | nnn-577e0284a11f675b7b9845da7e3a8006905b4fcf.tar.gz | |
Remove xdirname()
dirname(3) should be shot to death.
| -rw-r--r-- | noice.c | 16 |
1 files changed, 1 insertions, 15 deletions
@@ -118,20 +118,6 @@ xrealpath(const char *path) return p; } -char * -xdirname(const char *path) -{ - char *p, *tmp; - - /* Some implementations of dirname(3) may modify `path' */ - tmp = xstrdup(path); - p = dirname(tmp); - free(tmp); - if (p == NULL) - printerr(1, "dirname"); - return p; -} - void spawn(const char *file, const char *arg) { @@ -546,7 +532,7 @@ nochange: if (strcmp(path, "/") == 0) { goto nochange; } else { - dir = xdirname(path); + dir = dirname(path); tmp = xmalloc(strlen(dir) + 1); strlcpy(tmp, dir, strlen(dir) + 1); free(path); |