File: 100_ytasm_parsing_error.diff

package info (click to toggle)
yasm 1.3.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,708 kB
  • sloc: asm: 74,423; ansic: 53,052; python: 9,927; sh: 5,276; xml: 1,617; makefile: 214; pascal: 95; sed: 16
file content (28 lines) | stat: -rw-r--r-- 1,232 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Index: yasm-1.3.0/frontends/tasm/tasm-options.c
===================================================================
--- yasm-1.3.0.orig/frontends/tasm/tasm-options.c
+++ yasm-1.3.0/frontends/tasm/tasm-options.c
@@ -65,15 +66,18 @@ parse_cmdline(int argc, char **argv, opt
 
                     param = &argv[0][1+len];
                     if (options[i].takes_param) {
-                        if (param[0] == '\0') {
+                        if (param[0] != '\0') {
+                            /* do nothing */
+                        } else if (argc > 1) {
+                            param = argv[1];
+                            argc--;
+                            argv++;
+                        } else {
                             print_error(
-                                _("option `-%c' needs an argument!"),
+                                _("option `-%s' needs an argument!"),
                                 options[i].opt);
                             errors++;
                             goto fail;
-                        } else {
-                            argc--;
-                            argv++;
                         }
                     } else
                         param = NULL;