]> git.mxchange.org Git - simgear.git/commitdiff
Frederic Bouvier:
authorehofman <ehofman>
Sun, 21 Mar 2004 21:54:51 +0000 (21:54 +0000)
committerehofman <ehofman>
Sun, 21 Mar 2004 21:54:51 +0000 (21:54 +0000)
If the input string of sgSplitPath is empty, it returned a list with one empty string, not an empty list.

simgear/misc/sg_path.cxx

index eee649f7e8beb0aaafa282a1cded073cd6d627a4..95e2a505eb4893efeb77a0af4ecc67ccafdd6d2a 100644 (file)
@@ -189,7 +189,8 @@ string_list sgPathSplit( const string &search_path ) {
             result.push_back( tmp.substr(0, index) );
             tmp = tmp.substr( index + 1 );
         } else {
-            result.push_back( tmp );
+            if ( !tmp.empty() )
+                result.push_back( tmp );
             done = true;
         }
     }