Correct the usage of realpath() in cleanup
authorSampo Savolainen <v2@iki.fi>
Mon, 9 Apr 2007 17:15:44 +0000 (17:15 +0000)
committerSampo Savolainen <v2@iki.fi>
Mon, 9 Apr 2007 17:15:44 +0000 (17:15 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1690 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/session_state.cc

index c4563ce0e2aa63779b66be2e8e210baddd8e6ba4..119d2c858dd07de5f1f07eabee9566f68a9506b0 100644 (file)
@@ -2689,7 +2689,8 @@ Session::cleanup_sources (Session::cleanup_report& rep)
                } 
        }
 
-       char tmppath[PATH_MAX+1];
+       char tmppath1[PATH_MAX+1];
+       char tmppath2[PATH_MAX+1];
        
        for (vector<string*>::iterator x = soundfiles->begin(); x != soundfiles->end(); ++x) {
 
@@ -2698,7 +2699,10 @@ Session::cleanup_sources (Session::cleanup_report& rep)
 
                for (set<string>::iterator i = all_sources.begin(); i != all_sources.end(); ++i) {
 
-                       if (strcmp(realpath(spath.c_str(), tmppath), realpath( (*i).c_str(), tmppath)) == 0) {
+                       realpath(spath.c_str(), tmppath1);
+                       realpath((*i).c_str(),  tmppath2);
+
+                       if (strcmp(tmppath1, tmppath2) == 0) {
                                used = true;
                                break;
                        }