debian/changelog                                      |   15 +
 debian/patches/100_fix_crash_with_tektronix_mode.diff |   70 ++++++++
 debian/patches/101_670638.diff                        |  141 ++++++++++++++++++
 debian/patches/102_MdFlag.diff                        |   19 ++
 debian/patches/103_nullptr.diff                       |   28 +++
 debian/patches/series                                 |    5 
 6 files changed, 271 insertions(+), 7 deletions(-)

New commits:
commit 4b8d8d295fd453ad57ef5d90d04f6fc9d2f272ce
Author: Julien Cristau <jcris...@debian.org>
Date:   Tue Nov 27 19:57:50 2012 +0100

    Upload to unstable

diff --git a/debian/changelog b/debian/changelog
index 267c950..16f730e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xterm (278-3) UNRELEASED; urgency=low
+xterm (278-3) unstable; urgency=low
 
   [ Timo Aaltonen ]
   * control: Mark the package as Multi-Arch: foreign.
@@ -13,7 +13,7 @@ xterm (278-3) UNRELEASED; urgency=low
     - add a null-pointer check in OkPasswd macro to fix a problem in resize
       with Fedora 17 and a serial console (report/patch by Daniel Drake).
 
- -- Timo Aaltonen <tjaal...@ubuntu.com>  Fri, 28 Sep 2012 13:11:17 +0300
+ -- Julien Cristau <jcris...@debian.org>  Tue, 27 Nov 2012 19:57:47 +0100
 
 xterm (278-2) unstable; urgency=low
 

commit 120bdbd68c8447024b3ca2c1f14687c447914e82
Author: Julien Cristau <jcris...@debian.org>
Date:   Tue Nov 27 19:57:28 2012 +0100

    Apply a few patches recommended by upstream in #694375 (thanks!)
    
    - amend patch from 278-2 to catch more cases
    - amend fix for Debian #650291 in patch #277 changes to account for
      different data returned by vnc4server (closes: #670638)
    - correct macro definition used for testing modes used in ANSI/DEC
      request-mode controls introduced in patch #262
    - add a null-pointer check in OkPasswd macro to fix a problem in resize
      with Fedora 17 and a serial console (report/patch by Daniel Drake).

diff --git a/debian/changelog b/debian/changelog
index 356698b..267c950 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,18 @@
 xterm (278-3) UNRELEASED; urgency=low
 
+  [ Timo Aaltonen ]
   * control: Mark the package as Multi-Arch: foreign.
 
+  [ Julien Cristau ]
+  * Apply a few patches recommended by upstream in #694375 (thanks!)
+    - amend patch from 278-2 to catch more cases
+    - amend fix for Debian #650291 in patch #277 changes to account for
+      different data returned by vnc4server (closes: #670638)
+    - correct macro definition used for testing modes used in ANSI/DEC
+      request-mode controls introduced in patch #262
+    - add a null-pointer check in OkPasswd macro to fix a problem in resize
+      with Fedora 17 and a serial console (report/patch by Daniel Drake).
+
  -- Timo Aaltonen <tjaal...@ubuntu.com>  Fri, 28 Sep 2012 13:11:17 +0300
 
 xterm (278-2) unstable; urgency=low
diff --git a/debian/patches/100_fix_crash_with_tektronix_mode.diff 
b/debian/patches/100_fix_crash_with_tektronix_mode.diff
index eade1a1..bb4ff2b 100644
--- a/debian/patches/100_fix_crash_with_tektronix_mode.diff
+++ b/debian/patches/100_fix_crash_with_tektronix_mode.diff
@@ -1,7 +1,48 @@
-Fix crash in Tektronix mode (#685458).
---- a/input.c
-+++ b/input.c
-@@ -832,7 +832,7 @@ Input(XtermWidget xw,
+# ftp://invisible-island.net/temp/xterm-278-p4.patch.gz
+# patch by Thomas E. Dickey <dic...@invisible-island.net>
+# created  Tue Nov 27 10:17:35 UTC 2012
+# 
------------------------------------------------------------------------------
+# charproc.c |    8 ++++----
+# input.c    |    2 +-
+# misc.c     |    4 ++--
+# 3 files changed, 7 insertions(+), 7 deletions(-)
+# 
------------------------------------------------------------------------------
+Index: charproc.c
+--- xterm-278+/charproc.c      2012-01-19 00:22:08.000000000 +0000
++++ xterm-278-p4/charproc.c    2012-11-27 10:15:42.000000000 +0000
+@@ -3797,7 +3797,7 @@
+     XPoint spot;
+     XVaNestedList list;
+ 
+-    if (input->xic
++    if (input && input->xic
+       && (ld = getLineData(screen, screen->cur_row)) != 0) {
+       spot.x = (short) LineCursorX(screen, ld, screen->cur_col);
+       spot.y = (short) (CursorY(screen, screen->cur_row) + 
xw->misc.xim_fs_ascent);
+@@ -6952,7 +6952,7 @@
+ {
+     TInput *input = lookupTInput(xw, (Widget) xw);
+ 
+-    if (input->xim) {
++    if (input && input->xim) {
+       XCloseIM(input->xim);
+       input->xim = 0;
+       TRACE(("freed screen->xim\n"));
+@@ -7506,8 +7506,8 @@
+ 
+     TRACE(("xim_destroy_cb im=%lx, client=%p, call=%p\n",
+          (long) im, client_data, call_data));
+-
+-    input->xic = NULL;
++    if (input)
++      input->xic = NULL;
+     XRegisterIMInstantiateCallback(XtDisplay(xw), NULL, NULL, NULL,
+                                  xim_instantiate_cb, NULL);
+ }
+Index: input.c
+--- xterm-278+/input.c 2012-01-07 02:01:05.000000000 +0000
++++ xterm-278-p4/input.c       2012-11-27 10:15:42.000000000 +0000
+@@ -832,7 +832,7 @@
      {
  #if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
        TInput *input = lookupTInput(xw, (Widget) xw);
@@ -10,3 +51,24 @@ Fix crash in Tektronix mode (#685458).
            Status status_return;
  #if OPT_WIDE_CHARS
            if (screen->utf8_mode) {
+Index: misc.c
+--- xterm-278+/misc.c  2012-01-07 01:57:52.000000000 +0000
++++ xterm-278-p4/misc.c        2012-11-27 10:15:42.000000000 +0000
+@@ -180,7 +180,7 @@
+     {
+ #if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
+       TInput *input = lookupTInput(xw, (Widget) xw);
+-      if (input->xic)
++      if (input && input->xic)
+           XSetICFocus(input->xic);
+ #endif
+ 
+@@ -218,7 +218,7 @@
+       {
+ #if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
+           TInput *input = lookupTInput(xw, (Widget) xw);
+-          if (input->xic)
++          if (input && input->xic)
+               XUnsetICFocus(input->xic);
+ #endif
+ 
diff --git a/debian/patches/101_670638.diff b/debian/patches/101_670638.diff
new file mode 100644
index 0000000..c3e13bf
--- /dev/null
+++ b/debian/patches/101_670638.diff
@@ -0,0 +1,141 @@
+# ftp://invisible-island.net/temp/xterm-278-p3.patch.gz
+# patch by Thomas E. Dickey <dic...@invisible-island.net>
+# created  Tue Nov 27 10:17:15 UTC 2012
+# 
------------------------------------------------------------------------------
+# misc.c |   90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
+# 1 file changed, 78 insertions(+), 12 deletions(-)
+# 
------------------------------------------------------------------------------
+Index: misc.c
+--- xterm-278+/misc.c  2012-01-07 01:57:52.000000000 +0000
++++ xterm-278-p3/misc.c        2012-11-27 10:10:36.000000000 +0000
+@@ -2176,16 +2176,79 @@
+ #define ULONG_MAX (unsigned long)(~(0L))
+ #endif
+ 
+-static unsigned short
+-searchColortable(XColor * colortable, unsigned length, unsigned color)
++#define CheckColor(result, value) \
++          result = 0; \
++          if (value.red) \
++              result |= 1; \
++          if (value.green) \
++              result |= 2; \
++          if (value.blue) \
++              result |= 4
++
++#define SelectColor(state, value, result) \
++      switch (state) { \
++      default: \
++      case 1: \
++          result = value.red; \
++          break; \
++      case 2: \
++          result = value.green; \
++          break; \
++      case 4: \
++          result = value.blue; \
++          break; \
++      }
++
++/*
++ * Check if the color map consists of values in exactly one of the red, green
++ * or blue columns.  If it is not, we do not know how to use it for the exact
++ * match.
++ */
++static int
++simpleColors(XColor * colortable, unsigned length)
++{
++    unsigned n;
++    int state = -1;
++    int check;
++
++    for (n = 0; n < length; ++n) {
++      if (state == -1) {
++          CheckColor(state, colortable[n]);
++          if (state == 0)
++              state = -1;
++      }
++      if (state > 0) {
++          CheckColor(check, colortable[n]);
++          if (check > 0 && check != state) {
++              state = 0;
++              break;
++          }
++      }
++    }
++    switch (state) {
++    case 1:
++    case 2:
++    case 4:
++      break;
++    default:
++      state = 0;
++      break;
++    }
++    return state;
++}
++
++static unsigned
++searchColors(XColor * colortable, unsigned length, unsigned color, int state)
+ {
+     unsigned result = 0;
+     unsigned n;
+     unsigned long best = ULONG_MAX;
+     unsigned long diff;
++    unsigned value;
+ 
+     for (n = 0; n < length; ++n) {
+-      diff = (color - colortable[n].blue);
++      SelectColor(state, colortable[n], value);
++      diff = (color - value);
+       diff *= diff;
+       if (diff < best) {
+ #if 0
+@@ -2200,7 +2263,8 @@
+           best = diff;
+       }
+     }
+-    return colortable[result].blue;
++    SelectColor(state, colortable[result], value);
++    return value;
+ }
+ 
+ /*
+@@ -2243,20 +2307,19 @@
+     if (result) {
+       unsigned cmap_type;
+       unsigned cmap_size;
++      int state;
+ 
+       getColormapInfo(screen->display, &cmap_type, &cmap_size);
+ 
+       if ((cmap_type & 1) == 0) {
+           XColor temp = *def;
+ 
+-          if (loadColorTable(xw, cmap_size)) {
+-              /*
+-               * Note: the query will return only a value in the ".blue"
+-               * member, leaving ".red" and ".green" as zeros.
+-               */
+-              temp.red = searchColortable(screen->cmap_data, cmap_size, 
save.red);
+-              temp.green = searchColortable(screen->cmap_data, cmap_size, 
save.green);
+-              temp.blue = searchColortable(screen->cmap_data, cmap_size, 
save.blue);
++          if (loadColorTable(xw, cmap_size)
++              && (state = simpleColors(screen->cmap_data, cmap_size)) > 0) {
++#define SearchColors(which) temp.which = (unsigned short) 
searchColors(screen->cmap_data, cmap_size, save.which, state)
++              SearchColors(red);
++              SearchColors(green);
++              SearchColors(blue);
+               if (XAllocColor(screen->display, cmap, &temp) != 0) {
+ #if OPT_TRACE
+                   if (temp.red != save.red
+@@ -2265,6 +2328,9 @@
+                       TRACE(("...improved %x/%x/%x ->%x/%x/%x\n",
+                              save.red, save.green, save.blue,
+                              temp.red, temp.green, temp.blue));
++                  } else {
++                      TRACE(("...no improvement for %x/%x/%x\n",
++                             save.red, save.green, save.blue));
+                   }
+ #endif
+                   *def = temp;
diff --git a/debian/patches/102_MdFlag.diff b/debian/patches/102_MdFlag.diff
new file mode 100644
index 0000000..83549fc
--- /dev/null
+++ b/debian/patches/102_MdFlag.diff
@@ -0,0 +1,19 @@
+# ftp://invisible-island.net/temp/xterm-278-p2.patch.gz
+# patch by Thomas E. Dickey <dic...@invisible-island.net>
+# created  Tue Nov 27 10:17:13 UTC 2012
+# 
------------------------------------------------------------------------------
+# misc.c |    2 +-
+# 1 file changed, 1 insertion(+), 1 deletion(-)
+# 
------------------------------------------------------------------------------
+Index: misc.c
+--- xterm-278+/misc.c  2012-01-07 01:57:52.000000000 +0000
++++ xterm-278-p2/misc.c        2012-11-27 10:00:55.000000000 +0000
+@@ -3770,7 +3770,7 @@
+ };
+ 
+ #define MdBool(bool)      ((bool) ? mdMaybeSet : mdMaybeReset)
+-#define MdFlag(mode,flag) MdBool(xw->keyboard.flags & MODE_KAM)
++#define MdFlag(mode,flag) MdBool((mode) & (flag))
+ 
+ /*
+  * Reply is the same format as the query, with pair of mode/value:
diff --git a/debian/patches/103_nullptr.diff b/debian/patches/103_nullptr.diff
new file mode 100644
index 0000000..0db23e2
--- /dev/null
+++ b/debian/patches/103_nullptr.diff
@@ -0,0 +1,28 @@
+# ftp://invisible-island.net/temp/xterm-278-p1.patch.gz
+# patch by Thomas E. Dickey <dic...@invisible-island.net>
+# created  Tue Nov 27 10:17:11 UTC 2012
+# 
------------------------------------------------------------------------------
+# xstrings.c |    4 ++--
+# 1 file changed, 2 insertions(+), 2 deletions(-)
+# 
------------------------------------------------------------------------------
+Index: xstrings.c
+--- xterm-278+/xstrings.c      2011-09-11 20:20:12.000000000 +0000
++++ xterm-278-p1/xstrings.c    2012-11-27 10:01:42.000000000 +0000
+@@ -214,7 +214,7 @@
+     struct passwd *ptr = getpwnam(name);
+     Boolean code;
+ 
+-    if (OkPasswd(ptr)) {
++    if (ptr != 0 && OkPasswd(ptr)) {
+       code = True;
+       alloc_pw(result, ptr);
+     } else {
+@@ -234,7 +234,7 @@
+     struct passwd *ptr = getpwuid((uid_t) uid);
+     Boolean code;
+ 
+-    if (OkPasswd(ptr)) {
++    if (ptr != 0 && OkPasswd(ptr)) {
+       code = True;
+       alloc_pw(result, ptr);
+     } else {
diff --git a/debian/patches/series b/debian/patches/series
index 98395e1..8c1dc36 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,7 @@
+100_fix_crash_with_tektronix_mode.diff
+101_670638.diff
+102_MdFlag.diff
+103_nullptr.diff
 900_debian_xterm.diff
 902_windowops.diff
 904_fontops.diff
-100_fix_crash_with_tektronix_mode.diff


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1tdqpr-00013s...@vasks.debian.org

Reply via email to