Bug 109 - AppendNode causing Path to have double slash in path name
Summary: AppendNode causing Path to have double slash in path name
Status: CLOSED FIXED
Alias: None
Product: LinuxSampler
Classification: Unclassified
Component: gig::Engine (show other bugs)
Version: SVN Trunk
Hardware: PC Linux
: P2 blocker
Assignee: Grigor Iliev
URL:
Depends on:
Blocks:
 
Reported: 2008-11-30 10:07 CET by Chris Cherrett
Modified: 2008-12-16 13:20 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!