Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 5044

Summary: dialog does not work in some cases
Product: [Retired] Red Hat Linux Reporter: roganov
Component: dialogAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 6.0CC: ard, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-20 16:28:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description roganov 1999-09-10 14:33:32 UTC
The 'dialog' tool provided in RH 6.0 distribution does
not work in some cases.  Two known bugs are:

1.
	 dialog --yesno "hello" 80 20
       leads to:
         Segmentation fault (core dumped)

(above example just swaps correct "width" and "height")

2.
       for i in 20 40 60 80 ; do echo $i ; sleep 1 ; done |\
            dialog --gauge "hello" 20 70 0
       leads to:
            Broken pipe

Comment 1 ard 2000-01-20 13:44:59 UTC
This patch excludes the loop patch.
The loop patch checks that fd0 is a tty. Which, in case the --gauge
option is given, is a pipe.
--- dialog-0.6.spec.orig	Thu Jan 20 14:45:14 2000
+++ dialog-0.6.spec	Thu Jan 20 14:45:18 2000
@@ -23,7 +23,7 @@
 %setup -q
 %patch0 -p1 -b .ncurses
 %patch1 -p1 -b .opt
-%patch2 -p1 -b .loop
+# %patch2 -p1 -b .loop
 cd src
 make depend

Comment 2 Bill Nottingham 2000-01-20 16:28:59 UTC
Second is fixed in dialog-0.6-15; as for the
first, we're taking patches to make it smarter.

Comment 3 ard 2000-01-20 16:32:59 UTC
Allright, then we got a gauge, but thats a gauge without the bar I used to
know. I patched gauge.c a little, and now it has the status IWGEFM
(It Works Good Enough For Me :)).
Ehh, does Marc still maintain dialog?
--- gauge.c.orig	Mon Jan 16 00:48:14 1995
+++ gauge.c	Thu Jan 20 17:37:12 2000
@@ -72,17 +72,18 @@
 	  waddch(dialog, ' ');
       }

-      wattrset(dialog, title_attr);
-      wmove(dialog, height - 3, (width / 2) - 2);
-      sprintf(buf, "%3d%%", percent);
-      waddstr(dialog, buf);
-
       x = (percent * (width - 8)) / 100;
       wattrset(dialog, item_selected_attr);
       wmove(dialog, height - 3, 4);
       for (i = 0; i < x; i++) {
-	  waddch(dialog, winch(dialog));
+//waddch(dialog, winch(dialog));
+	  waddch(dialog, ACS_BLOCK);
       }
+      wattrset(dialog, title_attr);
+      wmove(dialog, height - 3, (width / 2) - 2);
+      sprintf(buf, "%3d%%", percent);
+      waddstr(dialog, buf);
+

       wrefresh(dialog);

Comment 4 ard 2000-01-20 16:51:59 UTC
Hmmm,
Debian has a cdialog0.9 version, based on dialog 0.6c
I will look into rpm'ing that version.
New features include time out etc...