diff options
author | jbj <devnull@localhost> | 2004-10-17 23:32:55 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2004-10-17 23:32:55 +0000 |
commit | ed4688aca76a81449ac3debdd8ef60a7afd5c45d (patch) | |
tree | 144fef9329d21c412344528e31f7c36eeed4b026 /lib | |
parent | 8f1ca37afaf5d83b9be72eb3e2aa6e2ed587084a (diff) | |
download | librpm-tizen-ed4688aca76a81449ac3debdd8ef60a7afd5c45d.tar.gz librpm-tizen-ed4688aca76a81449ac3debdd8ef60a7afd5c45d.tar.bz2 librpm-tizen-ed4688aca76a81449ac3debdd8ef60a7afd5c45d.zip |
Glob ftswalk/arglist args always.
CVS patchset: 7481
CVS date: 2004/10/17 23:32:55
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rpmgi.c | 19 | ||||
-rw-r--r-- | lib/rpmgi.h | 2 | ||||
-rw-r--r-- | lib/tgi.c | 19 |
3 files changed, 17 insertions, 23 deletions
diff --git a/lib/rpmgi.c b/lib/rpmgi.c index 341dc804c..1384f175f 100644 --- a/lib/rpmgi.c +++ b/lib/rpmgi.c @@ -109,14 +109,23 @@ fprintf(stderr, "*** gi %p\t%p\n", gi, gi->mi); break; case RPMGI_ARGLIST: case RPMGI_FTSWALK: - { ARGV_t argv = keyp; + { ARGV_t pav = keyp; + const char * arg; unsigned flags = keylen; + int xx; - gi->argv = argv; + gi->argv = xcalloc(1, sizeof(*gi->argv)); gi->argc = 0; - if (argv != NULL) - while (*argv++ != NULL) - gi->argc++; + if (pav != NULL) + while ((arg = *pav++) != NULL) { + ARGV_t av = NULL; + int ac; + + xx = rpmGlob(arg, &ac, &av); + xx = argvAppend(&gi->argv, av); + gi->argc += ac; + av = argvFree(av); + } gi->ftsOpts = flags; if (_rpmgi_debug < 0) diff --git a/lib/rpmgi.h b/lib/rpmgi.h index 53a9f3f7b..61b3b819c 100644 --- a/lib/rpmgi.h +++ b/lib/rpmgi.h @@ -117,7 +117,7 @@ rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi) * @return new general iterator */ /*@only@*/ -rpmgi rpmgiNew(rpmts ts, int tag, /*@only@*/ void *const keyp, size_t keylen) +rpmgi rpmgiNew(rpmts ts, int tag, void *const keyp, size_t keylen) /*@*/; const char * rpmgiNext(/*@null@*/ rpmgi gi) @@ -67,12 +67,10 @@ main(int argc, char *const argv[]) rpmts ts = NULL; rpmVSFlags vsflags; rpmgi gi = NULL; - const char ** pav; + const char ** av; const char * arg; - ARGV_t av; int ac; int rc = 0; - int xx; optCon = rpmcliInit(argc, argv, optionsTable); if (optCon == NULL) @@ -95,20 +93,7 @@ main(int argc, char *const argv[]) (void) rpmtsSetTid(ts, tid); } - pav = poptGetArgs(optCon); - - /* Glob all args and concatenate. */ - av = xcalloc(1, sizeof(*av)); - if (pav != NULL) - while ((arg = *pav++) != NULL) { - ARGV_t aav; - int aac; - aav = NULL; - xx = rpmGlob(arg, &aac, &aav); - xx = argvAppend(&av, aav); - aav = argvFree(aav); - } - + av = poptGetArgs(optCon); gi = rpmgiNew(ts, gitag, av, ftsOpts); (void) rpmgiSetQueryFormat(gi, queryFormat); |