From a1f9a0c19130720263c01303f17862dcd8cd8f1d Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Mon, 9 Feb 2009 17:58:42 +0000 Subject: [PATCH] Fixed crash on startup with Russian language svn path=/trunk/; revision=1061 --- ChangeLog | 8 +++++++- src/Win_GParted.cc | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6a573ce..7eddbe57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ 2009-02-09 Curtis Gedak - * README: Added -02-06 Curtis Gedak + * src/Win_GParted.cc: Fixed crash on startup with Russian language. + - Thanks to Dmitriy Motitskiy for small patch. + - Closes GParted bug #570855 + + * README: Added note blkid is used for ext4 detection. + +2009-02-06 Curtis Gedak * configure.in: Append -svn to version for continuing development diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index c65ac6b1..5470064b 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -229,8 +229,11 @@ void Win_GParted::init_toolbar() // FIXME: Is there a better way to do this, perhaps without the conditional? At the moment this seems to be the best compromise. bool display_undo = true ; if( str_temp .length() > 14 ) { - str_temp .replace( str_temp .find( "/" ), 1, "\n/" ) ; - display_undo = false ; + size_t index = str_temp .find( "/" ) ; + if ( index != Glib::ustring::npos ) { + str_temp .replace( index, 1, "\n/" ) ; + display_undo = false ; + } } toolbutton = Gtk::manage(new Gtk::ToolButton( *image, str_temp )); toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_resize) );