Strip the trailing '/' characters off of the url= option's

argument

Resolves issue #171


git-svn-id: http://s3fs.googlecode.com/svn/trunk@336 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
mooredan@suncup.net 2011-03-09 20:55:31 +00:00
parent 6cd9e9e65d
commit ebdde932a6

View File

@ -3814,6 +3814,16 @@ static int my_fuse_opt_proc(void *data, const char *arg, int key, struct fuse_ar
}
if (strstr(arg, "url=") != 0) {
host = strchr(arg, '=') + 1;
// strip the trailing '/', if any, off the end of the host
// string
size_t found, length;
found = host.find_last_of('/');
length = host.length();
while ( found == (length - 1) && length > 0 ) {
host.erase(found);
found = host.find_last_of('/');
length = host.length();
}
return 0;
}
// debug option