diff --git a/src/fat16.cc b/src/fat16.cc index 6e254db4..19871925 100644 --- a/src/fat16.cc +++ b/src/fat16.cc @@ -265,9 +265,15 @@ const Glib::ustring fat16::sanitize_label( const Glib::ustring &label ) const // https://technet.microsoft.com/en-us/library/bb490925.aspx // [2] Replicated in Wikikedia: label (command) // https://en.wikipedia.org/wiki/Label_%28command%29 - Glib::ustring prohibited_chars( "*?.,;:/\\|+=<>[]" ); + // Also exclude: + // * Single quote (') because it is encoded by mlabel but not understood by + // Windows; + // * ASCII control characters below SPACE because mlabel requests input in the + // same way it does for prohibited characters causing GParted to wait forever. + Glib::ustring prohibited_chars( "*?.,;:/\\|+=<>[]\"'" ); for ( unsigned int i = 0 ; i < uppercase_label.size() ; i ++ ) - if ( prohibited_chars.find( uppercase_label[i] ) == Glib::ustring::npos ) + if ( prohibited_chars.find( uppercase_label[i] ) == Glib::ustring::npos && + uppercase_label[i] >= ' ' ) new_label.push_back( uppercase_label[i] ); // Pad with spaces to prevent mlabel writing corrupted labels. See bug #700228.