be a bit more carefull about checking --rcfiles argument
authorewt <devnull@localhost>
Mon, 17 Feb 1997 20:28:50 +0000 (20:28 +0000)
committerewt <devnull@localhost>
Mon, 17 Feb 1997 20:28:50 +0000 (20:28 +0000)
CVS patchset: 1436
CVS date: 1997/02/17 20:28:50

rpm.c

diff --git a/rpm.c b/rpm.c
index 1cade4c..cb91bc5 100755 (executable)
--- a/rpm.c
+++ b/rpm.c
@@ -507,11 +507,11 @@ int main(int argc, char ** argv) {
     currarg = argv;
     while (*currarg) {
        if (!strcmp(*currarg, "--rcfile")) {
-           rcfile = *(currarg + 1);
+           rcfile = *(++currarg);
        } else if (!strcmp(*currarg, "--buildarch")) {
-           arch = *(currarg + 1);
+           arch = *(++currarg);
        } else if (!strcmp(*currarg, "--buildos")) {
-           os = *(currarg + 1);
+           os = *(++currarg);
        } else if (!strcmp(*currarg, "--showrc")) {
            showrc = 1;
            building = 1;
@@ -521,7 +521,8 @@ int main(int argc, char ** argv) {
                   !strcmp(*currarg, "--recompile")) {
            building = 1;
        }
-       currarg++;
+
+       if (*currarg) currarg++;
     } 
 
     /* reading this early makes it easy to override */