]> granicus.if.org Git - re2c/commitdiff
- Fix argument usage
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 15 Apr 2006 17:59:01 +0000 (17:59 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 15 Apr 2006 17:59:01 +0000 (17:59 +0000)
# lol at my self

lessons/001_upn_calculator/calc_001.c
lessons/001_upn_calculator/calc_001.re
lessons/001_upn_calculator/calc_002.c
lessons/001_upn_calculator/calc_002.re
lessons/001_upn_calculator/calc_003.c
lessons/001_upn_calculator/calc_003.re
lessons/001_upn_calculator/calc_004.c
lessons/001_upn_calculator/calc_004.re
lessons/001_upn_calculator/calc_005.c
lessons/001_upn_calculator/calc_005.re

index b758124e0ca4ac7b7bcba835f2210fdb2fa3444f..d565c5d613cd821f311e26f6ffbc08ee62a5a58a 100755 (executable)
@@ -135,13 +135,13 @@ yy18:
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                return scan(argv[1], strlen(argv[1]));
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 1;
        }
 }
index b603564d68012fad140281f832560e8f9e18bfeb..0e5e046197a58140ef494948b464623b255a7e68 100755 (executable)
@@ -72,13 +72,13 @@ int scan(char *s, int l)
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                return scan(argv[1], strlen(argv[1]));
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 1;
        }
 }
index 09f2eb004aebd9ea24d6481663592b25d510d984..4ecca471e8e2668d430a422e4576418bf2e46b9b 100755 (executable)
@@ -144,13 +144,13 @@ yy18:
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                return scan(argv[1]);
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 0;
        }
 }
index b805d845a6796c64ae9c61722f8bfb595986c3e3..e8dadae3eede17b4b550e8f9b448fc8e622b52b4 100755 (executable)
@@ -57,13 +57,13 @@ int scan(char *s)
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                return scan(argv[1]);
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 0;
        }
 }
index 58f1318381d20894ab25260f6439498c5181ab4f..64f3f2e2a6016fafd08f303e086e19135ea52982 100755 (executable)
@@ -136,13 +136,13 @@ yy18:
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                return scan(argv[1], strlen(argv[1]));
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 0;
        }
 }
index c4cd00f3ae5ffdba2e47d6a261aff9226c4849f6..4112cb3c4ba825d11f2cde9f6192ba01f67dda9c 100755 (executable)
@@ -49,13 +49,13 @@ int scan(char *s, int l)
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                return scan(argv[1], strlen(argv[1]));
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 0;
        }
 }
index d0dec85decc327fdfcf9cc1cd07f254ca8f9f58a..994c534aa8b1717c3929da78e997ba943f6278ce 100755 (executable)
@@ -143,13 +143,13 @@ yy17:
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                return scan(argv[1], strlen(argv[1]));
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 0;
        }
 }
index fd6d88a1b75c8a7865895390bcc91ef9df006ea7..f892afb98e32e0854d0e466c8444333b2c7028ef 100755 (executable)
@@ -66,13 +66,13 @@ int scan(char *s, int l)
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                return scan(argv[1], strlen(argv[1]));
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 0;
        }
 }
index b24a5c90c4bf7d5abece35b6533b07f3bbf51c30..827e75f112abdc4fcef47b564a725a575a808364 100755 (executable)
@@ -192,7 +192,7 @@ yy19:
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                char *inp;
                int res = 0, argp = 0, len;
@@ -229,7 +229,7 @@ int main(int argc, char **argv)
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 0;
        }
 }
index c19d38b10072d5eccf57ef3b30df432f0378cb12..20e8bcb228bbc51be8cc4259eb54d4a076c8708d 100755 (executable)
@@ -101,7 +101,7 @@ int scan(char *s, int l)
 
 int main(int argc, char **argv)
 {
-       if (argc > 0)
+       if (argc > 1)
        {
                char *inp;
                int res = 0, argp = 0, len;
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
        }
        else
        {
-               fprintf(stderr, "%s <expr>\n", argv[1]);
+               fprintf(stderr, "%s <expr>\n", argv[0]);
                return 0;
        }
 }