diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-05-29 11:15:53 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-05-29 11:25:37 +0200 |
| commit | 4ec646e5cfe7af548f26908fe16e19a2d7cc3797 (patch) | |
| tree | 2f8346ddbaae1f8e546ecf1925f44fd5d98826d9 /vis-menu.c | |
| parent | 2ac072176e2b6ecfad4427dfc798f63c834c38ad (diff) | |
| download | vis-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 { |
