From 4ec646e5cfe7af548f26908fe16e19a2d7cc3797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 29 May 2016 11:15:53 +0200 Subject: 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. --- vis-menu.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vis-menu.c') 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 { -- cgit v1.2.3