Skip to content

Commit

Permalink
Using String::Quote instead of double quotes
Browse files Browse the repository at this point in the history
- The previously seen issue have disappeared
  • Loading branch information
kobliha committed Nov 5, 2012
1 parent f3fd786 commit 33610bb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/functions.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -945,10 +945,6 @@ printf (\"%d%02d%02d%02d%02d%02d\", $year, $mon, $mday, $hour, $min, $sec);'");
return server + ":" + share + slash + filename;
}

define string quote(string var) {
return mergestring(splitstring(var, "\""), "\\\\\"");
}

/**
* Get available space in the directory
* @param directory selected directory
Expand All @@ -964,7 +960,7 @@ define string quote(string var) {
return $[];
}

string cmd = "/bin/df -P \"" + quote(directory) + "\"";
string cmd = sformat("/bin/df -P '%1'", String::Quote(directory));
map result = (map)SCR::Execute(.target.bash_output, cmd);
integer exit = result["exit"]:-1;

Expand Down

0 comments on commit 33610bb

Please sign in to comment.