]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
support --notags in whiptail checklist and radiolist (#1319794)
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 23 Mar 2016 11:05:52 +0000 (12:05 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 23 Mar 2016 11:07:51 +0000 (12:07 +0100)
The whiptail man page says the option is supported in the menu,
checklist and radiolist widgets, but it actually worked only in menu.

dialogboxes.c

index 3885068f4c697f13f2ffbab62611f30ab653b07c..d7902100913a2da79ede6b5c6a6493322416b469 100644 (file)
@@ -460,7 +460,11 @@ int checkList(const char * text, int height, int width, poptContext optCon,
     subform = newtForm(sb, NULL, 0);
     newtFormSetBackground(subform, NEWT_COLORSET_CHECKBOX);
 
-    snprintf(format, MAXFORMAT, "%%-%ds  %%s", maxWidth);
+    if (flags & FLAG_NOTAGS)
+       snprintf(format, MAXFORMAT, "%%.0s%%s");
+    else
+       snprintf(format, MAXFORMAT, "%%-%ds  %%s", maxWidth);
+
     for (i = 0; i < numBoxes; i++) {
        snprintf(buf, MAXBUF, format, cbInfo[i].tag, cbInfo[i].text);