aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-01-28 04:15:39 +0000
committerRichard M. Stallman1996-01-28 04:15:39 +0000
commitfd76ec52b3eff15330a1f95488d8c899ecf4ff25 (patch)
treea92b757f7f8b83230b9abf24c47710f2f7ce531a /src
parenta3fc4dee2cb3cc50362d98b8d062e85b974d6001 (diff)
downloademacs-fd76ec52b3eff15330a1f95488d8c899ecf4ff25.tar.gz
emacs-fd76ec52b3eff15330a1f95488d8c899ecf4ff25.zip
(sort_args): Error if option is missing an arg.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 90c66cd6cbe..4297163dde0 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1090,6 +1090,8 @@ sort_args (argc, argv)
1090 { 1090 {
1091 options[from] = standard_args[i].nargs; 1091 options[from] = standard_args[i].nargs;
1092 priority[from] = standard_args[i].priority; 1092 priority[from] = standard_args[i].priority;
1093 if (from + standard_args[i].nargs >= argc)
1094 fatal ("Option `%s' requires an argument\n", argv[from]);
1093 from += standard_args[i].nargs; 1095 from += standard_args[i].nargs;
1094 goto done; 1096 goto done;
1095 } 1097 }
@@ -1126,6 +1128,8 @@ sort_args (argc, argv)
1126 this option uses just one argv element. */ 1128 this option uses just one argv element. */
1127 if (equals != 0) 1129 if (equals != 0)
1128 options[from] = 0; 1130 options[from] = 0;
1131 if (from + options[from] >= argc)
1132 fatal ("Option `%s' requires an argument\n", argv[from]);
1129 from += options[from]; 1133 from += options[from];
1130 } 1134 }
1131 } 1135 }