From 1f166193fdae70800f0764cdce64eb9924013d1b Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Sun, 12 Jan 2025 15:47:24 -0600 Subject: add patch open selected --- st.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'st.c') 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]); -- cgit v1.2.3