Bug 109

Summary: AppendNode causing Path to have double slash in path name
Product: LinuxSampler Reporter: Chris Cherrett <stuff>
Component: gig::EngineAssignee: Grigor Iliev <gr.iliev>
Status: CLOSED FIXED    
Severity: blocker    
Priority: P2    
Version: SVN Trunk   
Hardware: PC   
OS: Linux   

Description Chris Cherrett 2008-11-30 10:07:14 CET
in src/db/InstrumentsDb.cpp

String InstrumentsDb::AppendNode(String DbDir, String Node) {
    if(DbDir.length() == 1 && DbDir.at(0) == '/') return DbDir + Node + "/";
    return DbDir "/" + Node + "/";
}

works if I change to:

String InstrumentsDb::AppendNode(String DbDir, String Node) {
       if(DbDir.length() == 1 && DbDir.at(0) == '/') return DbDir + Node + "/";
       int len = DbDir.length() - 1;
       if(DbDir.at(len) == '/') return DbDir + Node + "/";
       return DbDir + "/" + Node + "/";
}

For example:

/test1//Harp_1/

should be:

/test1/Harp_1/
Comment 1 Christian Schoenebeck 2008-12-14 14:38:27 CET
Grigor, do you think the patch can be applied that way?

I leave this report as blocker, since I think this should be resolved before 
the upcoming release.
Comment 2 Grigor Iliev 2008-12-14 23:38:51 CET
Finally found some time to look into this. The fix looks ok, just applied.
Thanks!