From 875152442420e578937585b0420c551b0c9c51b0 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Tue, 14 Nov 2006 00:22:06 +0200 Subject: [PATCH] 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. --- src/config/cmdline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/cmdline.c b/src/config/cmdline.c index 13a17111..87c19460 100644 --- a/src/config/cmdline.c +++ b/src/config/cmdline.c @@ -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;