Skip to content
Snippets Groups Projects
Commit 98bfd8a6 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

sh_quote added

Rev: lib/modules/Process.pmod:1.18
parent f75182a1
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,13 @@ int exec(string file,string ... foo) ...@@ -25,6 +25,13 @@ int exec(string file,string ... foo)
return 69; return 69;
} }
string sh_quote(string s)
{
return replace(s,
({"\\", "'", "\"", " "}),
({"\\\\", "\\'", "\\\"","\\ "}));
}
string *split_quoted_string(string s) string *split_quoted_string(string s)
{ {
s=replace(s, ({"\"","'","\\"," "}), ({"\0\"","\0'","\0\\","\0 "})); s=replace(s, ({"\"","'","\\"," "}), ({"\0\"","\0'","\0\\","\0 "}));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment