Skip to content

Commit

Permalink
Fix search that starts at root directory "/"
Browse files Browse the repository at this point in the history
Fix so that the user can do a search starting at the
root directory, e.g. "ag foo /"
  • Loading branch information
mmorearty committed Oct 3, 2012
1 parent 8b44fb1 commit 5ad53d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/options.c
Expand Up @@ -395,7 +395,7 @@ void parse_options(int argc, char **argv, char **paths[]) {
path = strdup(argv[i]);
path_len = strlen(path);
/* kill trailing slash */
if (path_len > 0 && path[path_len - 1] == '/') {
if (path_len > 1 && path[path_len - 1] == '/') {
path[path_len - 1] = '\0';
}
(*paths)[i] = path;
Expand Down

0 comments on commit 5ad53d7

Please sign in to comment.