From: Guillem Jover Date: Mon, 7 Jan 2008 09:51:57 +0000 (+0200) Subject: Use arglist instead of narglist X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30137f11135aed43df3736fceef91da388712cc4;p=dpkg Use arglist instead of narglist --- diff --git a/ChangeLog b/ChangeLog index abf6bbaf..04bfd76c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-07 Guillem Jover + + * src/archives.c (archivefiles): Use arglist instead of narglist. + 2008-01-07 Guillem Jover * lib/nfmalloc.c (nfmalloc): Remove inline keyword as extern inline diff --git a/src/archives.c b/src/archives.c index 71a12546..2309371c 100644 --- a/src/archives.c +++ b/src/archives.c @@ -1092,34 +1092,33 @@ void archivefiles(const char *const *argv) { m_pipe(pi); if (!(fc= m_fork())) { const char *const *ap; - char **narglist; int i; m_dup2(pi[1],1); close(pi[0]); close(pi[1]); for (i=0, ap=argv; *ap; ap++, i++); - narglist= m_malloc(sizeof(char*)*(i+15)); - narglist[0] = FIND; + arglist = m_malloc(sizeof(char *) * (i + 15)); + arglist[0] = FIND; for (i=1, ap=argv; *ap; ap++, i++) { if (strchr(FIND_EXPRSTARTCHARS,(*ap)[0])) { char *a; a= m_malloc(strlen(*ap)+10); strcpy(a,"./"); strcat(a,*ap); - narglist[i]= a; + arglist[i] = a; } else { - narglist[i] = (char *)*ap; + arglist[i] = (const char *)*ap; } } /* When editing these, make sure that arglist is malloced big enough, * above. */ - narglist[i++] = "-follow"; - narglist[i++] = "-name"; - narglist[i++] = ARCHIVE_FILENAME_PATTERN; - narglist[i++] = "-type"; - narglist[i++] = "f"; - narglist[i++] = "-print0"; - narglist[i++]= 0; - execvp(FIND, narglist); + arglist[i++] = "-follow"; + arglist[i++] = "-name"; + arglist[i++] = ARCHIVE_FILENAME_PATTERN; + arglist[i++] = "-type"; + arglist[i++] = "f"; + arglist[i++] = "-print0"; + arglist[i++] = 0; + execvp(FIND, (char *const *)arglist); ohshite(_("failed to exec find for --recursive")); } close(pi[1]);