[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@svn2.opensuse.org 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
Dne St 12. října 2011 16:53:59 Martin Vidner napsal(a):
- 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.
True, String::Quote was removed from this in next commit. j -- Jiri Suchomel SUSE LINUX, s.r.o. e-mail: jsuchome@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (2)
-
Jiri Suchomel
-
Martin Vidner