Skip to content

Commit

Permalink
Fixed small bug with ~ in r_file_globsearch ()
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanpencil committed Jul 26, 2018
1 parent 876642b commit e7f1f57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libr/util/file.c
Expand Up @@ -1078,11 +1078,11 @@ R_API RList* r_file_globsearch (char *globbed_path, int maxdepth) {
if (last_slash) {
glob_ptr = last_slash + 1;
if (globbed_path[0] == '~') {
char *rpath = r_str_nlen (globbed_path + 2, last_slash - globbed_path - 1);
path = r_str_home (rpath);
char *rpath = r_str_newlen (globbed_path + 2, last_slash - globbed_path - 1);
path = r_str_home (rpath ? : "");
free (rpath);
} else {
path = r_str_nlen (globbed_path, last_slash - globbed_path + 1);
path = r_str_newlen (globbed_path, last_slash - globbed_path + 1);
}
} else {
glob_ptr = globbed_path;
Expand Down

0 comments on commit e7f1f57

Please sign in to comment.