aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2025-01-12 15:47:24 -0600
committerTim Keller <tjkeller.xyz>2025-01-12 15:47:24 -0600
commit1f166193fdae70800f0764cdce64eb9924013d1b (patch)
tree4c11a349abcf81b4ceed9677db03fcb865410338 /st.c
parent48010bf2c4ba3ca33b5c82bc256133a6893bff3a (diff)
downloadst-1f166193fdae70800f0764cdce64eb9924013d1b.tar.xz
st-1f166193fdae70800f0764cdce64eb9924013d1b.zip
add patch open selected
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]);