Nick, I am your god.
authorSampo Savolainen <v2@iki.fi>
Sat, 23 Sep 2006 10:06:57 +0000 (10:06 +0000)
committerSampo Savolainen <v2@iki.fi>
Sat, 23 Sep 2006 10:06:57 +0000 (10:06 +0000)
(fix loading old sessions)

git-svn-id: svn://localhost/ardour2/trunk@924 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/session_state.cc

index 53a6273072c36e0ae7d6a58404990a16a32860f8..147a09d27dc35fad3bc059ec3de803d2b69c2fa4 100644 (file)
@@ -2249,17 +2249,21 @@ Session::sound_dir (bool with_path) const
        /* support old session structure */
 
        struct stat statbuf;
-       string old;
+       string old_nopath;
+       string old_withpath;
 
-       if (with_path) {
-               old = _path;
-       }
-
-       old += sound_dir_name;
-       old += '/';
+       old_nopath += old_sound_dir_name;
+       old_nopath += '/';
+       
+       old_withpath = _path;
+       old_withpath += old_sound_dir_name;
+       old_withpath += '/';
 
-       if (stat (old.c_str(), &statbuf) == 0) {
-               return old;
+       if (stat (old_withpath.c_str(), &statbuf) == 0) {
+               if (with_path)
+                       return old_withpath;
+               
+               return old_nopath;
        }
 
        string res;