aboutsummaryrefslogtreecommitdiff
path: root/vis-cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis-cmds.c')
-rw-r--r--vis-cmds.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vis-cmds.c b/vis-cmds.c
index f5221d1..a5c9f77 100644
--- a/vis-cmds.c
+++ b/vis-cmds.c
@@ -379,7 +379,11 @@ static bool is_file_pattern(const char *pattern) {
struct stat meta;
if (stat(pattern, &meta) == 0 && S_ISDIR(meta.st_mode))
return true;
- for (char special[] = "*?[{$~", *s = special; *s; s++) {
+ /* tilde expansion is defined only for the tilde at the
+ beginning of the pattern. */
+ if (pattern[0] == '~')
+ return true;
+ for (char special[] = "*?[{$", *s = special; *s; s++) {
if (strchr(pattern, *s))
return true;
}