aboutsummaryrefslogtreecommitdiffstats
path: root/noice.c
diff options
context:
space:
mode:
authorlostd <lostd@2f30.org>2014-10-07 14:47:35 +0000
committerlostd <>2014-10-07 14:47:35 +0000
commit9acdb3332b9c1e1fc0af8d1453dad0aa3b155e62 (patch)
tree804695c9a843cb68e9f1a05168267dd27734608f /noice.c
parenta543eed112b4167c410a2fb75d672df9df926a1a (diff)
downloadnoice-9acdb3332b9c1e1fc0af8d1453dad0aa3b155e62.tar.gz
Rework messages and errno warnings
Diffstat (limited to 'noice.c')
-rw-r--r--noice.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/noice.c b/noice.c
index 655ac39..224625b 100644
--- a/noice.c
+++ b/noice.c
@@ -109,13 +109,19 @@ exitcurses(void)
endwin(); /* Restore terminal */
}
-
-/* Warning shows up at the bottom */
+/* Messages show up at the bottom */
void
-printwarn(char *prefix)
+printmsg(char *msg)
{
move(LINES - 1, 0);
- printw("%s: %s\n", prefix, strerror(errno));
+ printw("%s\n", msg);
+}
+
+/* Display warning as a message */
+void
+printwarn(void)
+{
+ printmsg(strerror(errno));
}
/* Kill curses and display error before exiting */
@@ -218,7 +224,7 @@ begin:
dirp = opendir(path);
if (dirp == NULL) {
- printwarn("opendir");
+ printwarn();
goto nochange;
}
@@ -344,7 +350,7 @@ nochange:
path = newpath;
goto out;
} else {
- printwarn(newpath);
+ printwarn();
free(newpath);
goto nochange;
}
@@ -357,7 +363,7 @@ nochange:
/* Open with */
bin = openwith(name);
if (bin == NULL) {
- printwarn("no association\n");
+ printmsg("No association");
goto nochange;
}
Un proyecto texto-plano.xyz