summaryrefslogtreecommitdiff
path: root/doc/dialog/dialog-1.3-20190211.patch
diff options
context:
space:
mode:
Diffstat (limited to 'doc/dialog/dialog-1.3-20190211.patch')
-rw-r--r--doc/dialog/dialog-1.3-20190211.patch453
1 files changed, 453 insertions, 0 deletions
diff --git a/doc/dialog/dialog-1.3-20190211.patch b/doc/dialog/dialog-1.3-20190211.patch
new file mode 100644
index 0000000..3a5ce88
--- /dev/null
+++ b/doc/dialog/dialog-1.3-20190211.patch
@@ -0,0 +1,453 @@
+diff -b --unified -Nr dialog-1.3-20190211-orig/checklist.c dialog-1.3-20190211/checklist.c
+--- dialog-1.3-20190211-orig/checklist.c 2018-06-20 01:57:01.000000000 +0300
++++ dialog-1.3-20190211/checklist.c 2019-07-20 15:48:25.753332500 +0300
+@@ -29,7 +29,7 @@
+ #include <dialog.h>
+ #include <dlg_keys.h>
+
+-#define MIN_HIGH (1 + (5 * MARGIN))
++#define MIN_HIGH 4
+
+ typedef struct {
+ /* the outer-window */
+diff -b --unified -Nr dialog-1.3-20190211-orig/dialog-config.in dialog-1.3-20190211/dialog-config.in
+--- dialog-1.3-20190211-orig/dialog-config.in 2012-10-06 18:29:45.000000000 +0400
++++ dialog-1.3-20190211/dialog-config.in 2019-07-20 15:48:25.753332500 +0300
+@@ -73,12 +73,17 @@
+ INCS="-I${prefix}/include"
+ fi
+ sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
+- $INCS
++ @CFLAGS@ $INCS
++ENDECHO
++ ;;
++ --ldflags)
++ sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
++ -L@libdir@
+ ENDECHO
+ ;;
+ --libs)
+ sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
+- -L${exec_prefix}/lib -l${THIS} @LIBS@
++ -l${THIS} @LIBS@
+ ENDECHO
+ ;;
+ # identification
+@@ -113,6 +118,7 @@
+ --exec-prefix=ARG sets the executable-prefix of ${THIS}
+
+ --cflags echos the C compiler flags needed to compile with ${THIS}
++ --ldflags echos the linker flags needed to link with ${THIS}
+ --libs echos the libraries needed to link with ${THIS}
+
+ --version echos the release+patchdate version of ${THIS}
+diff -b --unified -Nr dialog-1.3-20190211-orig/dialog.m4 dialog-1.3-20190211/dialog.m4
+--- dialog-1.3-20190211-orig/dialog.m4 1970-01-01 03:00:00.000000000 +0300
++++ dialog-1.3-20190211/dialog.m4 2019-07-20 15:48:25.749332413 +0300
+@@ -0,0 +1,333 @@
++dnl #
++dnl # /usr/share/aclocal/dialog.m4
++dnl #
++dnl # Configure paths for dialog
++dnl # Andrew V.Kosteltsev
++
++dnl ============================================================
++dnl
++dnl Synopsis:
++dnl AC_CHECK_DIALOG([MIN-VERSION [, # minimum dialog version, e.g. 1.3-20190211
++dnl DEFAULT-WITH-DIALOG [, # default value for --with-dialog option
++dnl DEFAULT-WITH-DIALOG-TEST [,# default value for --with-dialog-test option
++dnl EXTEND-VARS [, # whether CFLAGS/LDFLAGS/etc are extended
++dnl ACTION-IF-FOUND [, # action to perform if dialog was found
++dnl ACTION-IF-NOT-FOUND # action to perform if dialog was not found
++dnl ]]]]]])
++dnl Examples:
++dnl AC_CHECK_DIALOG(1.3-20190211)
++dnl AC_CHECK_DIALOG(1.3-20190211,,,no,CFLAGS="$CFLAGS -DHAVE_DIALOG $DIALOG_CFLAGS")
++dnl AC_CHECK_DIALOG(1.3-20190211,yes,yes,yes,CFLAGS="$CFLAGS -DHAVE_DIALOG")
++dnl
++dnl
++dnl If you have to change prefix returned by dialog-config script or change
++dnl location of dialog-config, you may set environment variable DIALOG_CONFIG,
++dnl for example:
++dnl
++dnl # export DIALOG_CONFIG="dialog-config --prefix=/usr/local"
++dnl # export DIALOG_CONFIG="/usr/bin/dialog-config --prefix=/usr/local"
++dnl
++dnl ============================================================
++dnl
++dnl ============================================================
++dnl auxilliary macros
++dnl ============================================================
++AC_DEFUN([_AC_DIALOG_ERROR], [dnl
++AC_MSG_RESULT([*FAILED*])
++cat <<EOT | sed -e 's/^[[ ]]*/ | /' -e 's/>>/ /' 1>&2
++$1
++EOT
++exit 1
++])
++
++AC_DEFUN([_AC_DIALOG_VERBOSE], [dnl
++if test ".$verbose" = .yes; then
++ AC_MSG_RESULT([ $1])
++fi
++])
++
++dnl ============================================================
++dnl the user macro
++dnl ============================================================
++AC_DEFUN([AC_CHECK_DIALOG], [dnl
++dnl
++dnl ============================================================
++dnl prerequisites
++dnl ============================================================
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_PROG_CPP])dnl
++dnl
++dnl ============================================================
++dnl set DIALOG_CONFIG variable
++dnl ============================================================
++if test -z "$DIALOG_CONFIG"; then
++ DIALOG_CONFIG='dialog-config'
++fi
++dnl
++DIALOG_CFLAGS=''
++DIALOG_LDFLAGS=''
++DIALOG_LIBS=''
++AC_SUBST(DIALOG_CFLAGS)
++AC_SUBST(DIALOG_LDFLAGS)
++AC_SUBST(DIALOG_LIBS)
++dnl
++dnl ============================================================
++dnl command line options
++dnl ============================================================
++_AC_DIALOG_VERBOSE([])
++AC_ARG_WITH(dialog,dnl
++[ --with-dialog[=ARG] Build with dialog Library (default=]ifelse([$2],,yes,$2)[)],dnl
++,dnl
++with_dialog="ifelse([$2],,yes,$2)"
++)dnl
++AC_ARG_WITH(dialog-test,dnl
++[ --with-dialog-test Perform dialog Sanity Test (default=]ifelse([$3],,yes,$3)[)],dnl
++,dnl
++with_dialog_test="ifelse([$3],,yes,$3)"
++)dnl
++_AC_DIALOG_VERBOSE([+ Command Line Options:])
++_AC_DIALOG_VERBOSE([ o --with-dialog=$with_dialog])
++_AC_DIALOG_VERBOSE([ o --with-dialog-test=$with_dialog_test])
++dnl
++dnl ============================================================
++dnl configuration
++dnl ============================================================
++if test ".$with_dialog" != .no; then
++ dialog_subdir=no
++ dialog_subdir_opts=''
++ case "$with_dialog" in
++ subdir:* )
++ dialog_subdir=yes
++ changequote(, )dnl
++ dialog_subdir_opts=`echo $with_dialog | sed -e 's/^subdir:[^ ]*[ ]*//'`
++ with_dialog=`echo $with_dialog | sed -e 's/^subdir:\([^ ]*\).*$/\1/'`
++ changequote([, ])dnl
++ ;;
++ esac
++ dialog_version=""
++ dialog_location=""
++ dialog_type=""
++ dialog_cflags=""
++ dialog_ldflags=""
++ dialog_libs=""
++ if test ".$with_dialog" = .yes; then
++ # via config script in $PATH
++ changequote(, )dnl
++ dialog_version=`($DIALOG_CONFIG --version) 2>/dev/null |\
++ sed -e 's/^.*\([0-9]\.[0-9]*[-][0-9]*\).*$/\1/'`
++ changequote([, ])dnl
++ if test ".$dialog_version" != .; then
++ dialog_location=`$DIALOG_CONFIG --prefix`
++ dialog_type='installed'
++ dialog_cflags=`$DIALOG_CONFIG --cflags`
++ dialog_ldflags=`$DIALOG_CONFIG --ldflags`
++ dialog_libs=`$DIALOG_CONFIG --libs`
++ fi
++ elif test -d "$with_dialog"; then
++ with_dialog=`echo $with_dialog | sed -e 's;/*$;;'`
++ dialog_found=no
++ # via config script under a specified directory
++ # (a standard installation, but not a source tree)
++ if test ".$dialog_found" = .no; then
++ for _dir in $with_dialog/bin $with_dialog; do
++ if test -f "$_dir/dialog-config"; then
++ test -f "$_dir/dialog-config.in" && continue # dialog-config in source tree!
++ changequote(, )dnl
++ dialog_version=`($_dir/dialog-config --version) 2>/dev/null |\
++ sed -e 's/^.*\([0-9]\.[0-9]*[.][0-9]*\).*$/\1/'`
++ changequote([, ])dnl
++ if test ".$dialog_version" != .; then
++ dialog_location=`$_dir/dialog-config --prefix`
++ dialog_type="installed"
++ dialog_cflags=`$_dir/dialog-config --cflags`
++ dialog_ldflags=`$_dir/dialog-config --ldflags`
++ dialog_libs=`$_dir/dialog-config --libs`
++ dialog_found=yes
++ break
++ fi
++ fi
++ done
++ fi
++ fi
++ _AC_DIALOG_VERBOSE([+ Determined Location:])
++ _AC_DIALOG_VERBOSE([ o path: $dialog_location])
++ _AC_DIALOG_VERBOSE([ o type: $dialog_type])
++ if test ".$dialog_version" = .; then
++ if test ".$with_dialog" != .yes; then
++ _AC_DIALOG_ERROR([dnl
++ Unable to locate dialog under $with_dialog.
++ Please specify the correct path to either a dialog installation tree
++ (use --with-dialog=DIR if you used --prefix=DIR for installing dialog in
++ the past).])
++ else
++ _AC_DIALOG_ERROR([dnl
++ Unable to locate dialog in any system-wide location (see \$PATH).
++ Please specify the correct path to either a dialog installation tree
++ (use --with-dialog=DIR if you used --prefix=DIR for installing dialog in
++ the past, or set the DIALOG_CONFIG environment variable to the full path
++ to dialog-config).])
++ fi
++ fi
++ dnl ========================================================
++ dnl Check whether the found version is sufficiently new
++ dnl ========================================================
++ _req_version="ifelse([$1],,1.0.0,$1)"
++ for _var in dialog_version _req_version; do
++ eval "_val=\"\$${_var}\""
++ _major=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[.]]\)\([[0-9]]*\)/\1/'`
++ _minor=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[.]]\)\([[0-9]]*\)/\2/'`
++ _micro=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[.]]\)\([[0-9]]*\)/\4/'`
++ _hex=`echo dummy | awk '{ printf("%d%02d%02d", major, minor, micro); }' \
++ "major=$_major" "minor=$_minor" "micro=$_micro"`
++ eval "${_var}_hex=\"\$_hex\""
++ done
++ _AC_DIALOG_VERBOSE([+ Determined Versions:])
++ _AC_DIALOG_VERBOSE([ o existing: $dialog_version -> 0x$dialog_version_hex])
++ _AC_DIALOG_VERBOSE([ o required: $_req_version -> 0x$_req_version_hex])
++ _ok=0
++ if test ".$dialog_version_hex" != .; then
++ if test ".$_req_version_hex" != .; then
++ if test $dialog_version_hex -ge $_req_version_hex; then
++ _ok=1
++ fi
++ fi
++ fi
++ if test ".$_ok" = .0; then
++ _AC_DIALOG_ERROR([dnl
++ Found dialog version $dialog_version, but required at least version $_req_version.
++ Upgrade dialog under $dialog_location to $_req_version or higher first, please.])
++ fi
++ dnl ========================================================
++ dnl Perform dialog Sanity Compile Check
++ dnl ========================================================
++ if test ".$with_dialog_test" = .yes; then
++ _ac_save_CFLAGS="$CFLAGS"
++ _ac_save_LDFLAGS="$LDFLAGS"
++ _ac_save_LIBS="$LIBS"
++ CFLAGS="$CFLAGS $dialog_cflags"
++ LDFLAGS="$LDFLAGS $dialog_ldflags"
++ LIBS="$LIBS $dialog_libs"
++ _AC_DIALOG_VERBOSE([+ Test Build Environment:])
++ _AC_DIALOG_VERBOSE([ o CFLAGS=\"$CFLAGS\"])
++ _AC_DIALOG_VERBOSE([ o LDFLAGS=\"$LDFLAGS\"])
++ _AC_DIALOG_VERBOSE([ o LIBS=\"$LIBS\"])
++ cross_compile=no
++ define(_code1, [dnl
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <strings.h> /* index(3) */
++
++#include <dialog.h>
++#include <dlg_colors.h>
++#include <dlg_keys.h>
++
++ ])
++ define(_code2, [dnl
++
++int main( void )
++{
++ int status = 0;
++
++ bzero( (void *)&dialog_vars, sizeof(DIALOG_VARS) );
++
++ init_dialog(stdin, stdout);
++
++ dialog_vars.colors = 1;
++ dialog_vars.backtitle = "\\Z7Test\\Zn \\Z1dialog\\Zn \\Z7Library\\Zn";
++ dialog_vars.dlg_clear_screen = 1;
++ dialog_vars.sleep_secs = 1;
++
++
++ dlg_put_backtitle();
++
++ /*************************************************
++ Ruler: 68 characters + 2 spaces left and right:
++
++ | ----handy-ruler----------------------------------------------------- | */
++ status = dialog_msgbox( " \\Z4Dialog ==>\\Zn\\Z1libdialog\\Zn\\Z4<== [required]\\Zn ",
++ "\nPackage is installed and corect.\n",
++ 5, 72, 0 );
++
++ if( dialog_vars.sleep_secs )
++ (void)napms(dialog_vars.sleep_secs * 1000);
++
++ if( dialog_vars.dlg_clear_screen )
++ {
++ dlg_clear();
++ (void)refresh();
++ }
++ end_dialog();
++
++ exit( 0 );
++}
++ ])
++ _AC_DIALOG_VERBOSE([+ Performing Sanity Checks:])
++ _AC_DIALOG_VERBOSE([ o pre-processor test])
++ AC_TRY_CPP(_code1, _ok=yes, _ok=no)
++ if test ".$_ok" != .yes; then
++ _AC_DIALOG_ERROR([dnl
++ Found dialog $dialog_version under $dialog_location, but
++ was unable to perform a sanity pre-processor check. This means
++ the dialog header dialog.h was not found.
++ We used the following build environment:
++ >> CPP="$CPP"
++ See config.log for possibly more details.])
++ fi
++ _AC_DIALOG_VERBOSE([ o link check])
++ AC_TRY_LINK(_code1, _code2, _ok=yes, _ok=no)
++ if test ".$_ok" != .yes; then
++ _AC_DIALOG_ERROR([dnl
++ Found dialog $dialog_version under $dialog_location, but
++ was unable to perform a sanity linker check. This means
++ the dialog library libdialog.a was not found.
++ We used the following build environment:
++ >> CC="$CC"
++ >> CFLAGS="$CFLAGS"
++ >> LDFLAGS="$LDFLAGS"
++ >> LIBS="$LIBS"
++ See config.log for possibly more details.])
++ fi
++ _extendvars="ifelse([$4],,yes,$4)"
++ if test ".$_extendvars" != .yes; then
++ CFLAGS="$_ac_save_CFLAGS"
++ LDFLAGS="$_ac_save_LDFLAGS"
++ LIBS="$_ac_save_LIBS"
++ fi
++ else
++ _extendvars="ifelse([$4],,yes,$4)"
++ if test ".$_extendvars" = .yes; then
++ if test ".$dialog_subdir" = .yes; then
++ CFLAGS="$CFLAGS $dialog_cflags"
++ LDFLAGS="$LDFLAGS $dialog_ldflags"
++ LIBS="$LIBS $dialog_libs"
++ fi
++ fi
++ fi
++ DIALOG_CFLAGS="$dialog_cflags"
++ DIALOG_LDFLAGS="$dialog_ldflags"
++ DIALOG_LIBS="$dialog_libs"
++ AC_SUBST(DIALOG_CFLAGS)
++ AC_SUBST(DIALOG_LDFLAGS)
++ AC_SUBST(DIALOG_LIBS)
++
++ AC_SUBST(HAVE_DIALOG, [1])
++
++ AC_CHECK_HEADERS(dialog.h dlg_colors.h dlg_keys.h)
++
++ _AC_DIALOG_VERBOSE([+ Final Results:])
++ _AC_DIALOG_VERBOSE([ o DIALOG_CFLAGS=\"$DIALOG_CFLAGS\"])
++ _AC_DIALOG_VERBOSE([ o DIALOG_LDFLAGS=\"$DIALOG_LDFLAGS\"])
++ _AC_DIALOG_VERBOSE([ o DIALOG_LIBS=\"$DIALOG_LIBS\"])
++fi
++if test ".$with_dialog" != .no; then
++ AC_MSG_CHECKING(for libdialog)
++ AC_MSG_RESULT([version $dialog_version, $dialog_type under $dialog_location])
++ ifelse([$5], , :, [$5])
++else
++ AC_MSG_CHECKING(for libdialog)
++ AC_MSG_RESULT([no])
++ ifelse([$6], , :, [$6])
++fi
++])
++
+diff -b --unified -Nr dialog-1.3-20190211-orig/fselect.c dialog-1.3-20190211/fselect.c
+--- dialog-1.3-20190211-orig/fselect.c 2018-06-22 02:28:04.000000000 +0300
++++ dialog-1.3-20190211/fselect.c 2019-07-20 15:48:25.753332500 +0300
+@@ -631,7 +631,7 @@
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+- dialog = dlg_new_window(height, width,
++ dialog = dlg_new_window(height + 1, width,
+ dlg_box_y_ordinate(height),
+ dlg_box_x_ordinate(width));
+ dlg_register_window(dialog, "fselect", binding);
+@@ -639,7 +639,7 @@
+
+ dlg_mouse_setbase(0, 0);
+
+- dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr);
++ dlg_draw_box2(dialog, 0, 0, height + 1, width, dialog_attr, border_attr, border2_attr);
+ dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
+ dlg_draw_title(dialog, title);
+
+@@ -648,7 +648,7 @@
+ /* Draw the input field box */
+ tbox_height = 1;
+ tbox_width = width - (4 * MARGIN + 2);
+- tbox_y = height - (BTN_HIGH * 2) + MARGIN;
++ tbox_y = height - (BTN_HIGH * 2) + MARGIN + 1;
+ tbox_x = (width - tbox_width) / 2;
+
+ w_text = derwin(dialog, tbox_height, tbox_width, tbox_y, tbox_x);
+@@ -675,7 +675,7 @@
+ else
+ dbox_width = (width - (6 * MARGIN + 2 * EXT_WIDE)) / 2;
+ dbox_height = height - MIN_HIGH;
+- dbox_y = (2 * MARGIN + 1);
++ dbox_y = (2 * MARGIN + 2);
+ dbox_x = tbox_x;
+
+ w_work = derwin(dialog, dbox_height, dbox_width, dbox_y, dbox_x);
+@@ -735,7 +735,7 @@
+ if (show_buttons) {
+ show_buttons = FALSE;
+ button = (state < 0) ? 0 : state;
+- dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
++ dlg_draw_buttons(dialog, height - 1, 0, buttons, button, FALSE, width);
+ }
+
+ if (first_trace) {
+diff -b --unified -Nr dialog-1.3-20190211-orig/guage.c dialog-1.3-20190211/guage.c
+--- dialog-1.3-20190211-orig/guage.c 2018-06-21 11:23:43.000000000 +0300
++++ dialog-1.3-20190211/guage.c 2019-07-20 15:48:25.768332827 +0300
+@@ -377,6 +377,9 @@
+ MY_OBJ *obj = (MY_OBJ *) objptr;
+
+ if (valid(obj)) {
++ if (obj->title) free(obj->title);
++ if (obj->prompt) free(obj->prompt);
++
+ obj->obj.keep_win = FALSE;
+ dlg_remove_callback(&(obj->obj));
+ delink(obj);
+diff -b --unified -Nr dialog-1.3-20190211-orig/menubox.c dialog-1.3-20190211/menubox.c
+--- dialog-1.3-20190211-orig/menubox.c 2018-06-22 02:28:56.000000000 +0300
++++ dialog-1.3-20190211/menubox.c 2019-07-20 15:48:25.753332500 +0300
+@@ -48,7 +48,7 @@
+ int item_no;
+ } ALL_DATA;
+
+-#define MIN_HIGH (1 + (5 * MARGIN))
++#define MIN_HIGH 4
+
+ #define INPUT_ROWS 3 /* rows per inputmenu entry */
+