aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/st.c b/st.c
index 95dcac4..876f5cc 100644
--- a/st.c
+++ b/st.c
@@ -2236,6 +2236,16 @@ strhandle(void)
if (narg > 1)
xsettitle(strescseq.args[1], 0);
return;
+ case 7:
+ if (strstr(strescseq.args[1], "file://") != strescseq.args[1]) {
+ fprintf(stderr, "erresc: dir %s must have prefix 'file://'\n",
+ strescseq.args[1]);
+ return;
+ }
+ if (chdir(strescseq.args[1] + 7) != 0) /* +7 to remove prefix */
+ fprintf(stderr, "erresc: invalid directory %s\n",
+ strescseq.args[1]);
+ return;
case 52:
if (narg > 2 && allowwindowops) {
dec = base64dec(strescseq.args[2]);