rename save and save2 for clarity

The names saveDir and saveLnk seem to better define how these variables
are used.
This commit is contained in:
William Hubbs 2011-07-20 14:38:55 -05:00
parent 6fa6f9523f
commit 07694255a4

View File

@ -1100,7 +1100,8 @@ runscript(int argc, char **argv)
bool doneone = false; bool doneone = false;
int retval, opt, depoptions = RC_DEP_TRACE; int retval, opt, depoptions = RC_DEP_TRACE;
RC_STRING *svc; RC_STRING *svc;
char path[PATH_MAX], lnk[PATH_MAX], *dir, *save = NULL, *save2 = NULL; char path[PATH_MAX], lnk[PATH_MAX];
char *dir, *saveDir = NULL, *saveLnk = NULL;
char pidstr[10]; char pidstr[10];
size_t l = 0, ll; size_t l = 0, ll;
const char *file; const char *file;
@ -1132,14 +1133,14 @@ runscript(int argc, char **argv)
if (readlink(argv[1], lnk, sizeof(lnk)-1)) { if (readlink(argv[1], lnk, sizeof(lnk)-1)) {
dir = dirname(path); dir = dirname(path);
if (strchr(lnk, '/')) { if (strchr(lnk, '/')) {
save = xstrdup(dir); saveDir = xstrdup(dir);
save2 = xstrdup(lnk); saveLnk = xstrdup(lnk);
dir = dirname(save2); dir = dirname(saveLnk);
if (strcmp(dir, save) == 0) if (strcmp(dir, saveDir) == 0)
file = basename_c(argv[1]); file = basename_c(argv[1]);
else else
file = basename_c(lnk); file = basename_c(lnk);
dir = save; dir = saveDir;
} else } else
file = basename_c(argv[1]); file = basename_c(argv[1]);
ll = strlen(dir) + strlen(file) + 2; ll = strlen(dir) + strlen(file) + 2;
@ -1149,8 +1150,8 @@ runscript(int argc, char **argv)
free(service); free(service);
service = xstrdup(lnk); service = xstrdup(lnk);
} }
free(save); free(saveDir);
free(save2); free(saveLnk);
} }
if (!service) if (!service)
service = xstrdup(path); service = xstrdup(path);