mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-11 00:21:45 +00:00
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:
parent
6cd9e9e65d
commit
ebdde932a6
10
src/s3fs.cpp
10
src/s3fs.cpp
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user