[gparted] Avoid using String::ucompose to build command lines
- From: Mike Fleetwood <mfleetwo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Avoid using String::ucompose to build command lines
- Date: Wed, 5 Mar 2014 22:12:25 +0000 (UTC)
commit 7b1011237ca8921163f1cc576f9df7047e337c31
Author: Curtis Gedak <gedakc gmail com>
Date: Mon Mar 3 11:01:15 2014 -0700
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)
e494eca1f7798d98cc4e83fb2875f1c409d0ac98
src/xfs.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/xfs.cc b/src/xfs.cc
index 82ffa42..a92ba99 100644
--- a/src/xfs.cc
+++ b/src/xfs.cc
@@ -141,9 +141,9 @@ bool xfs::write_label( const Partition & partition, OperationDetail & operationd
{
Glib::ustring cmd = "" ;
if( partition .get_label() .empty() )
- cmd = String::ucompose( "xfs_admin -L -- %1", partition .get_path() ) ;
+ cmd = "xfs_admin -L -- " + partition .get_path() ;
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 ) ;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]