From 5ad53d7e00768246a5cbac79c586ef70938ad2ef Mon Sep 17 00:00:00 2001 From: Mike Morearty Date: Wed, 3 Oct 2012 13:30:53 -0700 Subject: [PATCH] Fix search that starts at root directory "/" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix so that the user can do a search starting at the root directory, e.g. "ag foo /" --- src/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options.c b/src/options.c index 10161613a..b72f339b9 100644 --- a/src/options.c +++ b/src/options.c @@ -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;