mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Bug 830: Check -remote command names more strictly.
doc/remote.txt says there must be a nonempty sequence of ASCII alphabetic characters before the opening parenthesis. Check that they really are ASCII characters and that the sequence is nonempty. Thus, elinks -remote '(foo)' now treats the string as an address, rather than as a command.
This commit is contained in:
parent
8b8cd57941
commit
24dbdbe899
@ -225,7 +225,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
|
|||||||
|
|
||||||
command = *(*argv);
|
command = *(*argv);
|
||||||
|
|
||||||
while (isalpha(command[len]))
|
while (isasciialpha(command[len]))
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
/* Find the begining and end of the argument list. */
|
/* Find the begining and end of the argument list. */
|
||||||
@ -240,7 +240,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
|
|||||||
|
|
||||||
/* Decide whether to use the "extended" --remote format where
|
/* Decide whether to use the "extended" --remote format where
|
||||||
* all URLs following should be opened in tabs. */
|
* all URLs following should be opened in tabs. */
|
||||||
if (*arg != '(' || *argend != ')') {
|
if (len == 0 || *arg != '(' || *argend != ')') {
|
||||||
/* Just open any passed URLs in new tabs */
|
/* Just open any passed URLs in new tabs */
|
||||||
remote_session_flags |= SES_REMOTE_NEW_TAB;
|
remote_session_flags |= SES_REMOTE_NEW_TAB;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user