From 09ba2389fea6e3273adc510dd6ae183585793e85 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Fri, 10 Feb 2017 19:21:12 +0000 Subject: [PATCH] - updated to 1.3-20170131 --- dialog.spec | 6 +- escaping_fix.patch | 134 --------------------------------------------- 2 files changed, 3 insertions(+), 137 deletions(-) delete mode 100644 escaping_fix.patch diff --git a/dialog.spec b/dialog.spec index 57bb492..5a22744 100644 --- a/dialog.spec +++ b/dialog.spec @@ -1,5 +1,5 @@ %define ver 1.3 -%define sdate 20160424 +%define sdate 20170131 Summary: A program to build tty dialog boxes Summary(de.UTF-8): Ein Programm zum Erstellen von tty-Dialogfeldern Summary(fr.UTF-8): Programme pour construire des boîtes de dialogue en mode texte @@ -12,7 +12,7 @@ Epoch: 1 License: LGPL v2.1 Group: Applications/Terminal Source0: ftp://invisible-island.net/dialog/%{name}-%{ver}-%{sdate}.tgz -# Source0-md5: 582d804252205f73df2d892ebdc5212e +# Source0-md5: 4e2b623dae67351c8483149a30019d49 Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2 # Source1-md5: 932081790cd8aa857822bd2b0eafa5bb URL: http://invisible-island.net/dialog/dialog.html @@ -115,7 +115,7 @@ rm -rf $RPM_BUILD_ROOT %doc CHANGES README %attr(755,root,root) %{_bindir}/dialog %attr(755,root,root) %{_libdir}/libdialog.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libdialog.so.13 +%attr(755,root,root) %ghost %{_libdir}/libdialog.so.14 %{_mandir}/man1/dialog.1* %lang(hu) %{_mandir}/hu/man1/dialog.1* %lang(pl) %{_mandir}/pl/man1/dialog.1* diff --git a/escaping_fix.patch b/escaping_fix.patch deleted file mode 100644 index 2dffd8c..0000000 --- a/escaping_fix.patch +++ /dev/null @@ -1,134 +0,0 @@ -diff -ur dialog-1.3-20160209.orig/argv.c dialog-1.3-20160209/argv.c ---- dialog-1.3-20160209.orig/argv.c 2015-05-13 00:34:39.000000000 +0000 -+++ dialog-1.3-20160209/argv.c 2016-02-11 10:41:08.705828223 +0000 -@@ -55,12 +55,18 @@ - ++count; - inparm = TRUE; - } -- } else if (!quoted && isspace(UCH(blob[n]))) { -- if (inparm) { -+ } else if (blob[n] == '\\') { -+ if (quoted && !isspace(UCH(blob[n + 1]))) { - if (pass) { -- *param++ = '\0'; -+ *param++ = blob[n]; -+ *param++ = blob[n + 1]; - } -- inparm = FALSE; -+ } -+ ++n; -+ } else if (!quoted && isspace(UCH(blob[n]))) { -+ inparm = FALSE; -+ if (pass) { -+ *param++ = '\0'; - } - } else { - if (!inparm) { -@@ -69,10 +75,6 @@ - ++count; - inparm = TRUE; - } -- if (blob[n] == '\\') { -- if (++n == length) -- break; /* The string is terminated by a backslash */ -- } - if (pass) { - *param++ = blob[n]; - } -diff -ur dialog-1.3-20160209.orig/dialog.c dialog-1.3-20160209/dialog.c ---- dialog-1.3-20160209.orig/dialog.c 2016-02-09 00:05:39.000000000 +0000 -+++ dialog-1.3-20160209/dialog.c 2016-02-11 10:41:08.707828223 +0000 -@@ -421,58 +421,49 @@ - blob[length] = '\0'; - - list = dlg_string_to_argv(blob); -- added = dlg_count_argv(list); -- if (added > 2) { -- /* *argcp arguments before the expansion of --file -- - 2 for the removal of '--file ' -- + added for the arguments contained in -- + 1 for the terminating NULL pointer */ -- size_t need = (size_t) (*argcp + added - 1); -- if (doalloc) { -- *argvp = dlg_realloc(char *, need, *argvp); -- assert_ptr(*argvp, "unescape_argv"); -- } else { -- char **newp = dlg_malloc(char *, need); -- assert_ptr(newp, "unescape_argv"); -- for (n = 0; n < *argcp; ++n) { -- newp[n] = (*argvp)[n]; -+ if ((added = dlg_count_argv(list)) != 0) { -+ if (added > 2) { -+ size_t need = (size_t) (*argcp + added + 1); -+ if (doalloc) { -+ *argvp = dlg_realloc(char *, need, *argvp); -+ assert_ptr(*argvp, "unescape_argv"); -+ } else { -+ char **newp = dlg_malloc(char *, need); -+ assert_ptr(newp, "unescape_argv"); -+ for (n = 0; n < *argcp; ++n) { -+ newp[n] = (*argvp)[n]; -+ } -+ *argvp = newp; -+ doalloc = TRUE; - } -- /* The new array is not NULL-terminated yet. */ -- *argvp = newp; -- doalloc = TRUE; -+ dialog_opts = dlg_realloc(bool, need, dialog_opts); -+ assert_ptr(dialog_opts, "unescape_argv"); - } -- dialog_opts = dlg_realloc(bool, need, dialog_opts); -- assert_ptr(dialog_opts, "unescape_argv"); -- -- /* Shift the arguments after '--file ' -- right by (added - 2) positions */ -- for (n = *argcp - 1; n >= j + 2; --n) { -- (*argvp)[n + added - 2] = (*argvp)[n]; -- dialog_opts[n + added - 2] = dialog_opts[n]; -+ if (added > 2) { -+ for (n = *argcp; n >= j + 2; --n) { -+ (*argvp)[n + added - 2] = (*argvp)[n]; -+ dialog_opts[n + added - 2] = dialog_opts[n]; -+ } -+ } else if (added == 1) { -+ for (n = j; n < *argcp; ++n) { -+ (*argvp)[n] = (*argvp)[n + 1]; -+ dialog_opts[n] = dialog_opts[n + 1]; -+ } - } -- } else if (added < 2) { -- /* 0 or 1 argument read from the included file -- -> shift the arguments after '--file ' -- left by (2 - added) positions */ -- for (n = j + added; n + 2 - added < *argcp; ++n) { -- (*argvp)[n] = (*argvp)[n + 2 - added]; -- dialog_opts[n] = dialog_opts[n + 2 - added]; -+ for (n = 0; n < added; ++n) { -+ (*argvp)[n + j] = list[n]; -+ dialog_opts[n + j] = FALSE; - } -+ *argcp += added - 2; -+ free(list); -+ --j; /* force rescan */ - } -- /* Copy the inserted arguments to *argvp */ -- for (n = 0; n < added; ++n) { -- (*argvp)[n + j] = list[n]; -- dialog_opts[n + j] = FALSE; -- } -- *argcp += added - 2; -- (*argvp)[*argcp] = 0; /* Write the NULL terminator */ -- free(list); /* No-op if 'list' is NULL */ -- /* Force rescan starting from the first inserted argument */ -- --j; -- continue; - } else { - dlg_exiterr("Cannot open --file %s", filename); - } -+ (*argvp)[*argcp] = 0; -+ ++j; -+ continue; - } else { - dlg_exiterr("No value given for --file"); - } -- 2.46.0