Avoid using String::ucompose to build command lines

The String::ucompose method is for easy, i18n-friendly composition of
strings with Gtkmm.  From past experience, String::ucompose should not
be used to build command lines due to differences in how locales handle
number translation.  More specifically, not all locales use number
separators (spaces, commas or periods) and the decimal separator
(period or comma) in the same way.

The problem with using String::ucompose for command lines was
originally encountered and corrected in the following commit:

Fix attempt data rescue fail to open read-only view (#673246)
e494eca1f7
This commit is contained in:
Curtis Gedak 2014-03-03 11:01:15 -07:00 committed by Mike Fleetwood
parent 86111fe12a
commit 7b1011237c
1 changed files with 2 additions and 2 deletions

View File

@ -141,9 +141,9 @@ bool xfs::write_label( const Partition & partition, OperationDetail & operationd
{ {
Glib::ustring cmd = "" ; Glib::ustring cmd = "" ;
if( partition .get_label() .empty() ) if( partition .get_label() .empty() )
cmd = String::ucompose( "xfs_admin -L -- %1", partition .get_path() ) ; cmd = "xfs_admin -L -- " + partition .get_path() ;
else else
cmd = String::ucompose( "xfs_admin -L \"%1\" %2", partition .get_label(), partition .get_path() ) ; cmd = "xfs_admin -L \"" + partition .get_label() + "\" " + partition .get_path() ;
return ! execute_command( cmd, operationdetail ) ; return ! execute_command( cmd, operationdetail ) ;
} }