[dev] [vis][RFC][PATCH 1/2] Replace first '/' of substitute command with \0

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Tue, 5 May 2015 18:25:29 +0200

Replacing the first '/' allows the 's' command name to be correctly
identified even though it is part of its own argument.

This is hacky because afterwards we will add the '/' back in before
calling the 'sed' program.

Signed-off-by: Silvan Jegen <s.jegen_AT_gmail.com>
---
 vis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vis.c b/vis.c
index 628f511..201d88a 100644
--- a/vis.c
+++ b/vis.c
_AT_@ -1764,7 +1764,7 @@ static bool exec_cmdline_command(const char *cmdline) {
 	while (*name == ' ')
 		name++;
 	char *param = name;
-	while (*param && *param != ' ') {
+	while (*param && *param != ' ' && *param != '/') {
 		if (*param == '!') {
 			opt |= CMD_OPT_FORCE;
 			break;
-- 
2.3.7
Received on Tue May 05 2015 - 18:25:29 CEST

This archive was generated by hypermail 2.3.0 : Tue May 05 2015 - 18:36:23 CEST