summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index adb0f22..54335c5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7081,6 +7081,10 @@ subevalvar(char *start, char *str, int strloc,
*repl = '\0';
break;
}
+ if ((unsigned char)*repl == CTLENDVAR) { /* ${v/pattern} (no trailing /, no repl) */
+ repl = NULL;
+ break;
+ }
/* Handle escaped slashes, e.g. "${v/\//_}" (they are CTLESC'ed by this point) */
if ((unsigned char)*repl == CTLESC && repl[1])
repl++;