Mailinglist Archive: yast-devel (78 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] r66356 - String::Quote misused, misdesigned
String::Quote is actually an awful name:

String::Quote("Martin's File; rm -rf /") -> "Martin'\\''s File; rm -rf /"

To be of any use, you must wrap its result with single quotes.

On Mon, Oct 10, 2011 at 10:54:08AM -0000, jsuchome@xxxxxxxxxxxxxxxxx wrote:
Author: jsuchome
Date: Mon Oct 10 12:54:07 2011
New Revision: 66356

URL: http://svn.opensuse.org/viewcvs/yast?rev=66356&view=rev
Log:
- agent: pass map refereces as arguments
- quote strings passed to bash commands
- fixed testsuite
- 2.21.13
@@ -636,7 +637,7 @@
files = filter (string file, files, {
if (haskey (files_index, file))
{
- to_restore = add (to_restore, Snapper::GetFileFullPath
(file));
+ to_restore = add (to_restore, String::Quote
(Snapper::GetFileFullPath (file)));
return true;
}
else


This is suspicious. And indeed, to_restore is not passed to
.target.bash later. In this case it is only displayed to the user.

.target.bash sucks.
--
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
< Previous Next >
Follow Ups