From 52fa584106e076d4b819515c2829e1ba51a5fdf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Sun, 23 Jul 2000 14:47:30 -0700 Subject: [PATCH] bugfix for Process.split_quoted_string Rev: lib/modules/Process.pmod:1.25 --- lib/modules/Process.pmod | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod index 886d263357..a5b010a5eb 100644 --- a/lib/modules/Process.pmod +++ b/lib/modules/Process.pmod @@ -34,6 +34,7 @@ string sh_quote(string s) array(string) split_quoted_string(string s) { + sscanf(s,"%*[ \n\t]%s",s); s=replace(s, ({"\"", "'", "\\", " ", "\t", "\n"}), ({"\0\"","\0'","\0\\","\0 ","\0\t","\0\n"})); @@ -56,7 +57,7 @@ array(string) split_quoted_string(string s) case '\'': ret[-1]+=x[e][1..]; - while(x[++e][0]!='\'') ret[-1]+=x[e]; + while(x[++e][0]!='\'') ret[-1]+=x[e][1..]; ret[-1]+=x[e][1..]; break; @@ -72,7 +73,8 @@ array(string) split_quoted_string(string s) case ' ': case '\t': case '\n': - while(strlen(x[e])==1 && (<' ','\t','\n'>) [x[e][0]] ) + while(strlen(x[e])==1 && e+1 < sizeof(x) && + (<' ','\t','\n'>) [x[e+1][0]]) if(++e >= sizeof(x)) return ret; ret+=({x[e][1..]}); -- GitLab