]> Pileus Git - ~andy/gtk/commitdiff
Don't mangle sequences of consecutive \n or \r.
authorOwen Taylor <otaylor@redhat.com>
Mon, 14 Jan 2002 23:11:35 +0000 (23:11 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 14 Jan 2002 23:11:35 +0000 (23:11 +0000)
Mon Jan 14 17:14:13 2002  Owen Taylor  <otaylor@redhat.com>
        * gdk/x11/gdkselection-x11.c (sanitize_utf8): Don't
        mangle sequences of consecutive \n or \r.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkselection-x11.c

index 6af1b6edbdf348b87780eac13707f43bf4b541db..4564055dbee3f890db369e7feb8fe3c63e709261 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jan 14 17:14:13 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (sanitize_utf8): Don't
+       mangle sequences of consecutive \n or \r.
+
 Mon Jan 14 17:42:28 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_stop_editing): allow cancel to
index 6af1b6edbdf348b87780eac13707f43bf4b541db..4564055dbee3f890db369e7feb8fe3c63e709261 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jan 14 17:14:13 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (sanitize_utf8): Don't
+       mangle sequences of consecutive \n or \r.
+
 Mon Jan 14 17:42:28 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_stop_editing): allow cancel to
index 6af1b6edbdf348b87780eac13707f43bf4b541db..4564055dbee3f890db369e7feb8fe3c63e709261 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jan 14 17:14:13 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (sanitize_utf8): Don't
+       mangle sequences of consecutive \n or \r.
+
 Mon Jan 14 17:42:28 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_stop_editing): allow cancel to
index 6af1b6edbdf348b87780eac13707f43bf4b541db..4564055dbee3f890db369e7feb8fe3c63e709261 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jan 14 17:14:13 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (sanitize_utf8): Don't
+       mangle sequences of consecutive \n or \r.
+
 Mon Jan 14 17:42:28 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_stop_editing): allow cancel to
index 6af1b6edbdf348b87780eac13707f43bf4b541db..4564055dbee3f890db369e7feb8fe3c63e709261 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jan 14 17:14:13 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (sanitize_utf8): Don't
+       mangle sequences of consecutive \n or \r.
+
 Mon Jan 14 17:42:28 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_stop_editing): allow cancel to
index 6af1b6edbdf348b87780eac13707f43bf4b541db..4564055dbee3f890db369e7feb8fe3c63e709261 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jan 14 17:14:13 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (sanitize_utf8): Don't
+       mangle sequences of consecutive \n or \r.
+
 Mon Jan 14 17:42:28 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_stop_editing): allow cancel to
index 6af1b6edbdf348b87780eac13707f43bf4b541db..4564055dbee3f890db369e7feb8fe3c63e709261 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jan 14 17:14:13 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (sanitize_utf8): Don't
+       mangle sequences of consecutive \n or \r.
+
 Mon Jan 14 17:42:28 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_stop_editing): allow cancel to
index 4cadfb63cfac9e1d9b11a2d4851d06ddf1ff9257..893d475ce1ed999955f7fd848f91c08c43cac60b 100644 (file)
@@ -528,7 +528,7 @@ gdk_string_to_compound_text (const gchar *str,
  * routines for COMPOUND_TEXT only enforce this in one direction,
  * causing cut-and-paste of \r and \r\n separated text to fail.
  * This routine strips out all non-allowed C0 and C1 characters
- * from the input string and also canonicalizes \r, \r\n, and \n\r to \n
+ * from the input string and also canonicalizes \r, and \r\n to \n
  */
 static gchar * 
 sanitize_utf8 (const gchar *src)
@@ -539,10 +539,10 @@ sanitize_utf8 (const gchar *src)
 
   while (*p)
     {
-      if (*p == '\r' || *p == '\n')
+      if (*p == '\r')
        {
          p++;
-         if (*p == '\r' || *p == '\n')
+         if (*p == '\n')
            p++;
 
          g_string_append_c (result, '\n');
@@ -553,7 +553,7 @@ sanitize_utf8 (const gchar *src)
          char buf[7];
          gint buflen;
          
-         if (!((ch < 0x20 && ch != '\t') || (ch >= 0x7f && ch < 0xa0)))
+         if (!((ch < 0x20 && ch != '\t' && ch != '\n') || (ch >= 0x7f && ch < 0xa0)))
            {
              buflen = g_unichar_to_utf8 (ch, buf);
              g_string_append_len (result, buf, buflen);