diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index a4cf352b00..61fc1ac0a8 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -71814,18 +71814,16 @@ public: for (int i = 0; i < items.size(); i += 2) { - String name (items[i]); - String name2 (items[i + 1]); - + const String name (items[i]); + const String name2 (items[i + 1]); String commonBit; - for (int j = 0; j < name.length(); ++j) - if (name.substring (0, j).equalsIgnoreCase (name2.substring (0, j))) - commonBit = name.substring (0, j); + if (! CharacterFunctions::isDigit (name[0])) + for (int j = 0; j < name.length(); ++j) + if (name.substring (0, j).equalsIgnoreCase (name2.substring (0, j))) + commonBit = name.substring (0, j); - pairs.add (name.trim() - + " + " - + name2.substring (commonBit.length()).trim()); + pairs.add (name.trim() + " + " + name2.substring (commonBit.length()).trim()); } items = pairs; diff --git a/src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp b/src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp index 0b86a9b201..3f023a2e1e 100644 --- a/src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp +++ b/src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp @@ -726,18 +726,16 @@ public: for (int i = 0; i < items.size(); i += 2) { - String name (items[i]); - String name2 (items[i + 1]); - + const String name (items[i]); + const String name2 (items[i + 1]); String commonBit; - for (int j = 0; j < name.length(); ++j) - if (name.substring (0, j).equalsIgnoreCase (name2.substring (0, j))) - commonBit = name.substring (0, j); + if (! CharacterFunctions::isDigit (name[0])) + for (int j = 0; j < name.length(); ++j) + if (name.substring (0, j).equalsIgnoreCase (name2.substring (0, j))) + commonBit = name.substring (0, j); - pairs.add (name.trim() - + " + " - + name2.substring (commonBit.length()).trim()); + pairs.add (name.trim() + " + " + name2.substring (commonBit.length()).trim()); } items = pairs;