1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-04 02:35:29 +00: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:
Kalle Olavi Niemitalo 2006-11-14 00:22:06 +02:00 committed by Jonas Fonseca
parent dbfb34f395
commit 8751524424

View File

@ -225,7 +225,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
command = *(*argv);
while (isalpha(command[len]))
while (isasciialpha(command[len]))
len++;
/* 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
* all URLs following should be opened in tabs. */
if (*arg != '(' || *argend != ')') {
if (len == 0 || *arg != '(' || *argend != ')') {
/* Just open any passed URLs in new tabs */
remote_session_flags |= SES_REMOTE_NEW_TAB;
return NULL;