aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-11-29 22:47:52 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-11-29 22:47:52 +0100
commit7c37ec643a2332a04b3c5be1e0ea300693f2d3c9 (patch)
tree53f5e71e17a43a27529f63964b5b15738a493667
parent4a9f67c17aeab884db1566180477c9e174687cdd (diff)
downloadvis-7c37ec643a2332a04b3c5be1e0ea300693f2d3c9.tar.gz
vis-7c37ec643a2332a04b3c5be1e0ea300693f2d3c9.tar.xz
cmd_write: show error message for non-existing path components
-rw-r--r--sam.c4
1 files changed, 3 insertions, 1 deletions
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);