]> code.delx.au - gnu-emacs/blobdiff - src/w16select.c
(add_to_log): Pass 1 byte less to message_dolog.
[gnu-emacs] / src / w16select.c
index 68e958fa427179f138e095c952995283db023e54..674be37544e38b23e9c1a104d186eab1ddd7854f 100644 (file)
@@ -369,10 +369,6 @@ get_clipboard_data (Format, Data, Size, Raw)
   __dpmi_regs regs;
   unsigned long xbuf_addr;
   unsigned char *dp = Data;
-  /* The last 32-byte aligned block of data.  See commentary below.  */
-  unsigned char *last_block = dp + ((Size & 0x1f)
-                                   ? (Size & 0x20)
-                                   : Size - 0x20);
 
   if (Format != CF_OEMTEXT)
     return 0;
@@ -419,22 +415,22 @@ get_clipboard_data (Format, Data, Size, Raw)
              dp--;
              *dp++ = '\n';
              xbuf_addr++;
-             last_block--;     /* adjust the beginning of the last 32 bytes */
              if (*lcdp == '\n')
                lcdp++;
            }
          /* Windows reportedly rounds up the size of clipboard data
-            (passed in SIZE) to a multiple of 32.  We therefore bail
-            out when we see the first null character in the last 32-byte
-            block.  */
-         else if (c == '\0' && dp > last_block)
+            (passed in SIZE) to a multiple of 32, and removes trailing
+            spaces from each line without updating SIZE.  We therefore
+            bail out when we see the first null character.  */
+         else if (c == '\0')
            break;
        }
 
       /* If the text in clipboard is identical to what we put there
         last time set_clipboard_data was called, pretend there's no
         data in the clipboard.  This is so we don't pass our own text
-        from the clipboard.  */
+        from the clipboard (which might be troublesome if the killed
+        text includes null characters).  */
       if (last_clipboard_text &&
          xbuf_addr - xbuf_beg == (long)(lcdp - last_clipboard_text))
        dp = (unsigned char *)Data + 1;