diff options
author | jbj <devnull@localhost> | 2001-05-29 15:03:35 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-05-29 15:03:35 +0000 |
commit | 61cd63ab8e816d46e81b3df2bb8cfe9b2267f85d (patch) | |
tree | 435a2ee8e9fdf33d9af2f4188dd9e100ac36e1e4 /rpmqv.c | |
parent | e6c22123bc088afd6f0f564b8f5224af3cf2d2e6 (diff) | |
download | librpm-tizen-61cd63ab8e816d46e81b3df2bb8cfe9b2267f85d.tar.gz librpm-tizen-61cd63ab8e816d46e81b3df2bb8cfe9b2267f85d.tar.bz2 librpm-tizen-61cd63ab8e816d46e81b3df2bb8cfe9b2267f85d.zip |
- eliminate db-1.85 and db-2.x configuration.
- fix: popt arg sanity checks broken, optarg != optArg.
- fix: popt range checks on floats/doubles broken.
- popt: return POPT_ERROR_ERRNO on config open/read/close failure.
CVS patchset: 4815
CVS date: 2001/05/29 15:03:35
Diffstat (limited to 'rpmqv.c')
-rwxr-xr-x | rpmqv.c | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -786,6 +786,15 @@ int main(int argc, const char ** argv) rpmSetVerbosity(RPMMESS_NORMAL); /* XXX silly use by showrc */ +#if 0 + { const char ** avp; + fprintf(stderr, "==> argv[%d]:", argc); + for (avp = argv; *avp; avp++) + fprintf(stderr, " '%s'", *avp); + fprintf(stderr, "\n"); + } +#endif + /* Make a first pass through the arguments, looking for --rcfile */ /* We need to handle that before dealing with the rest of the arguments. */ /*@-nullpass -temptrans@*/ @@ -904,10 +913,8 @@ int main(int argc, const char ** argv) #endif case GETOPT_EXCLUDEPATH: - /*@-nullderef@*/ /* LCL: optarg != NULL */ - if (optarg == NULL || *optArg != '/') + if (optArg == NULL || *optArg != '/') argerror(_("exclude paths must begin with a /")); - /*@=nullderef@*/ relocations = xrealloc(relocations, sizeof(*relocations) * (numRelocations + 1)); @@ -919,12 +926,10 @@ int main(int argc, const char ** argv) case GETOPT_RELOCATE: { char * newPath = NULL; - /*@-nullderef -nullpass@*/ /* LCL: optarg != NULL */ - if (optarg == NULL || *optArg != '/') + if (optArg == NULL || *optArg != '/') argerror(_("relocations must begin with a /")); if (!(newPath = strchr(optArg, '='))) argerror(_("relocations must contain a =")); - /*@=nullderef =nullpass@*/ *newPath++ = '\0'; if (*newPath != '/') argerror(_("relocations must have a / following the =")); @@ -975,21 +980,21 @@ int main(int argc, const char ** argv) #endif /* IAM_RPMK */ case GETOPT_DEFINEMACRO: - /*@-nullderef -nullpass@*/ /* LCL: optarg != NULL */ - if (optarg == NULL) break; /* XXX can't happen. */ - (void) rpmDefineMacro(NULL, optArg, RMIL_CMDLINE); - (void) rpmDefineMacro(&rpmCLIMacroContext, optArg, RMIL_CMDLINE); - /*@=nullderef =nullpass@*/ + if (optArg) { + (void) rpmDefineMacro(NULL, optArg, RMIL_CMDLINE); + (void) rpmDefineMacro(&rpmCLIMacroContext, optArg,RMIL_CMDLINE); + } noUsageMsg = 1; break; case GETOPT_EVALMACRO: - if (optarg == NULL) break; /* XXX can't happen. */ - { const char *val = rpmExpand(optArg, NULL); - fprintf(stdout, "%s\n", val); - free((void *)val); + if (optArg) { + const char *val = rpmExpand(optArg, NULL); + fprintf(stdout, "%s\n", val); + val = _free(val); + } noUsageMsg = 1; - } break; + break; #if defined(GETOPT_RCFILE) case GETOPT_RCFILE: |