aboutsummaryrefslogtreecommitdiff
path: root/vis-menu.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-29 11:15:53 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-29 11:25:37 +0200
commit4ec646e5cfe7af548f26908fe16e19a2d7cc3797 (patch)
tree2f8346ddbaae1f8e546ecf1925f44fd5d98826d9 /vis-menu.c
parent2ac072176e2b6ecfad4427dfc798f63c834c38ad (diff)
downloadvis-4ec646e5cfe7af548f26908fe16e19a2d7cc3797.tar.gz
vis-4ec646e5cfe7af548f26908fe16e19a2d7cc3797.tar.xz
vis-menu: improve empty prompt handling (vis-menu -p '')
The textw{,n} functions should probably be changed to not accomodate for leading and trailing spaces. They should also be changed to properly calculate the display width of an UTF-8 encoded string. Currently they will just return the number of codepoints which is obviously wrong.
Diffstat (limited to 'vis-menu.c')
-rw-r--r--vis-menu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vis-menu.c b/vis-menu.c
index 5c08f6e..a316240 100644
--- a/vis-menu.c
+++ b/vis-menu.c
@@ -585,6 +585,8 @@ main(int argc, char **argv) {
usage();
} else if (!strcmp(argv[i], "-p")) {
prompt = argv[++i];
+ if (prompt && !prompt[0])
+ prompt = NULL;
} else if (!strcmp(argv[i], "-l")) {
lines = atoi(argv[++i]);
} else {