From 217e9bce9cdc1d0d4142da94351e9b9efdc0d1fd Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Thu, 26 May 2011 04:17:06 +0100 Subject: [PATCH] buf -> cwd --- ls.c | 10 +++++----- util/recurse.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ls.c b/ls.c index f89b918..10a82b6 100644 --- a/ls.c +++ b/ls.c @@ -89,13 +89,13 @@ ls(char *path) void lsdir(const char *path) { - char *buf, *p; + char *cwd, *p; long i, n = 0; struct dirent *d; DIR *dp; Entry *ents = NULL; - buf = agetcwd(); + cwd = agetcwd(); if(!(dp = opendir(path))) eprintf("opendir %s:", path); if(chdir(path) != 0) @@ -119,10 +119,10 @@ lsdir(const char *path) output(&ents[i]); free(ents[i].name); } - if(chdir(buf) != 0) - eprintf("chdir %s:", buf); + if(chdir(cwd) != 0) + eprintf("chdir %s:", cwd); free(ents); - free(buf); + free(cwd); } void diff --git a/util/recurse.c b/util/recurse.c index a8d3928..d7a4e47 100644 --- a/util/recurse.c +++ b/util/recurse.c @@ -10,7 +10,7 @@ void recurse(const char *path, void (*fn)(const char *)) { - char *buf; + char *cwd; struct dirent *d; DIR *dp; @@ -20,7 +20,7 @@ recurse(const char *path, void (*fn)(const char *)) else eprintf("opendir %s:", path); } - buf = agetcwd(); + cwd = agetcwd(); if(chdir(path) != 0) eprintf("chdir %s:", path); while((d = readdir(dp))) @@ -28,7 +28,7 @@ recurse(const char *path, void (*fn)(const char *)) fn(d->d_name); closedir(dp); - if(chdir(buf) != 0) - eprintf("chdir %s:", buf); - free(buf); + if(chdir(cwd) != 0) + eprintf("chdir %s:", cwd); + free(cwd); }