diff options
author | Maxim Konovalov <maxim@FreeBSD.org> | 2003-06-30 11:49:00 +0000 |
---|---|---|
committer | Maxim Konovalov <maxim@FreeBSD.org> | 2003-06-30 11:49:00 +0000 |
commit | ed10a496b1555f758f55f9850ba6c1f966d72c52 (patch) | |
tree | e70c38ffc89e5fbfcfc67707e1e37aa85758d650 /usr.bin | |
parent | df9c6cda37b2844f79f14e173e59fc73fc2eac46 (diff) | |
download | src-ed10a496b1555f758f55f9850ba6c1f966d72c52.tar.gz src-ed10a496b1555f758f55f9850ba6c1f966d72c52.zip |
o Support for '--' to cancel options list processing.
PR: bin/32433
Prodded by: Zak Johnson <zakj-freebsd-hackers@nox.cx>
Obtained from: easyedit-1.4.6
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=117070
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ee/ee.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/ee/ee.c b/usr.bin/ee/ee.c index 1d80b965bcf5..10e28744667d 100644 --- a/usr.bin/ee/ee.c +++ b/usr.bin/ee/ee.c @@ -2041,6 +2041,7 @@ char *arguments[]; struct files *temp_names = NULL; char *name; char *ptr; + int no_more_opts = FALSE; /* | see if editor was invoked as 'ree' (restricted mode) @@ -2057,7 +2058,7 @@ char *arguments[]; input_file = FALSE; recv_file = FALSE; count = 1; - while (count < numargs) + while ((count < numargs) && (!no_more_opts)) { buff = arguments[count]; if (!strcmp("-i", buff)) @@ -2086,9 +2087,18 @@ char *arguments[]; buff++; start_at_line = buff; } - + else if (!(strcmp("--", buff))) + no_more_opts = TRUE; else { + count--; + no_more_opts = TRUE; + } + count++; + } + while (count < numargs) + { + buff = arguments[count]; if (top_of_stack == NULL) { temp_names = top_of_stack = name_alloc(); @@ -2109,7 +2119,6 @@ char *arguments[]; temp_names->next_name = NULL; input_file = TRUE; recv_file = TRUE; - } count++; } } |