From 7c37ec643a2332a04b3c5be1e0ea300693f2d3c9 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 29 Nov 2025 22:47:52 +0100 Subject: cmd_write: show error message for non-existing path components --- sam.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sam.c b/sam.c index d32066d..ae4106a 100644 --- a/sam.c +++ b/sam.c @@ -1661,8 +1661,10 @@ static bool cmd_write(Vis *vis, Win *win, Command *cmd, const char *argv[], Sele for (const char **name = argv[1] ? &argv[1] : (const char*[]){ filename, NULL }; *name; name++) { char *path = absolute_path(*name); - if (!path) + if (!path) { + vis_info_show(vis, "Can't open file for writing: %s", strerror(errno)); return false; + } struct stat meta; bool existing_file = !stat(path, &meta); -- cgit v1.2.3