Debian Bug report logs - #196297
patch: CR stripping broken for unified diffs

version graph

Package: patch; Maintainer for patch is Laszlo Boszormenyi (GCS) <gcs@debian.org>; Source for patch is src:patch.

Reported by: André Dahlqvist <anedah-9@student.luth.se>

Date: Thu, 5 Jun 2003 22:18:01 UTC

Severity: normal

Tags: upstream

Found in version 2.5.9-1

Fixed in version patch/2.5.9-2

Done: Michael Fedrowitz <michaelf@debian.org>

Bug is archived. No further changes may be made.

Forwarded to bug-patch@gnu.org

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Michael Fedrowitz <michaelf@debian.org>:
Bug#196297; Package patch. Full text and rfc822 format available.

Acknowledgement sent to André Dahlqvist <anedah-9@student.luth.se>:
New Bug report received and forwarded. Copy sent to Michael Fedrowitz <michaelf@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: André Dahlqvist <anedah-9@student.luth.se>
To: submit@bugs.debian.org
Subject: Patch rejected with patch 2.5.9-1
Date: Fri, 06 Jun 2003 00:16:57 +0200
[Message part 1 (text/plain, inline)]
Package: patch
Version: 2.5.9-1

After doing my last upgrade of Sid I cannot apply a patch to Mozilla 
Thunderbird which I have always been able to. If I downgrade to patch 
2.5.4-11 the same patch file can be applied. The previous version of 
patch that I had must have been 2.5.8-2 and that also worked.

Below is the output when trying to apply the patch with patch-2.5.9-1 
and patch-2.5.4-11. The patch is identical:

With patch 2.5.9-1
------------------
patching file allmakefiles.sh
Hunk #1 FAILED at 867.
1 out of 1 hunk FAILED -- saving rejects to file allmakefiles.sh.rej
patching file Makefile.in
Hunk #1 FAILED at 231.
Hunk #2 FAILED at 273.
2 out of 2 hunks FAILED -- saving rejects to file Makefile.in.rej
patching file toolkit/jar.mn
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file toolkit/jar.mn.rej
patching file toolkit/components/Makefile.in
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file 
toolkit/components/Makefile.in.rej
patching file toolkit/content/finddialog.js
Hunk #1 FAILED at 28.
Hunk #2 FAILED at 88.
Hunk #3 FAILED at 113.
3 out of 3 hunks FAILED -- saving rejects to file 
toolkit/content/finddialog.js.rej
patching file toolkit/content/xul.css
Hunk #1 FAILED at 644.
Hunk #2 FAILED at 706.
2 out of 2 hunks FAILED -- saving rejects to file 
toolkit/content/xul.css.rej
patching file toolkit/content/widgets/checkbox.xml
Hunk #1 FAILED at 14.
1 out of 1 hunk FAILED -- saving rejects to file 
toolkit/content/widgets/checkbox.xml.rej
patching file toolkit/skin/win/autocomplete.css
Hunk #1 FAILED at 115.
1 out of 1 hunk FAILED -- saving rejects to file 
toolkit/skin/win/autocomplete.css.rej
patching file toolkit/skin/win/jar.mn
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file toolkit/skin/win/jar.mn.rej

With patch 2.5.4-11
-------------------
(Stripping trailing CRs from patch.)
patching file allmakefiles.sh
(Stripping trailing CRs from patch.)
patching file Makefile.in
(Stripping trailing CRs from patch.)
patching file toolkit/jar.mn
(Stripping trailing CRs from patch.)
patching file toolkit/components/Makefile.in
(Stripping trailing CRs from patch.)
patching file toolkit/content/finddialog.js
(Stripping trailing CRs from patch.)
patching file toolkit/content/xul.css
Hunk #1 succeeded at 648 (offset 4 lines).
Hunk #2 succeeded at 710 (offset 4 lines).
(Stripping trailing CRs from patch.)
patching file toolkit/content/widgets/checkbox.xml
(Stripping trailing CRs from patch.)
patching file toolkit/skin/win/autocomplete.css
(Stripping trailing CRs from patch.)
patching file toolkit/skin/win/jar.mn

Is it possible that the new version of patch has broken handling of 
trailing CR:s? I have attached the patch file itself also.
-- 

André Dahlqvist <anedah-9@student.luth.se>
[newToolkit.diff (text/plain, inline)]
? toolkit/xre/xulapp_s.lib
Index: allmakefiles.sh
===================================================================
RCS file: /cvsroot/mozilla/allmakefiles.sh,v
retrieving revision 1.416
diff -u -w -r1.416 allmakefiles.sh
--- allmakefiles.sh	5 May 2003 11:25:43 -0000	1.416
+++ allmakefiles.sh	24 May 2003 01:57:08 -0000
@@ -867,6 +867,8 @@
 toolkit/components/satchel/Makefile
 toolkit/components/satchel/public/Makefile
 toolkit/components/satchel/src/Makefile
+toolkit/components/Makefile
+toolkit/components/console/Makefile
 toolkit/content/mac/Makefile
 toolkit/skin/mac/Makefile
 toolkit/skin/unix/Makefile
Index: Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/Makefile.in,v
retrieving revision 1.219
diff -u -w -r1.219 Makefile.in
--- Makefile.in	17 May 2003 00:58:24 -0000	1.219
+++ Makefile.in	24 May 2003 01:57:08 -0000
@@ -231,8 +231,11 @@
 tier_9_dirs	+= l10n
 endif
 
-ifdef MOZ_PHOENIX
+ifdef MOZ_XUL_APP
 tier_9_dirs	+= toolkit
+endif
+
+ifdef MOZ_PHOENIX
 # remove this when bug 201821 is fixed
 tier_9_dirs	+= browser/components/bookmarks/public
 endif
@@ -270,7 +273,7 @@
 endif
 
 ifdef MOZ_THUNDERBIRD
-tier_99_dirs	+= toolkit/xre mail
+tier_99_dirs	+= mail
 endif
 
 ifdef MOZ_XUL_APP
Index: toolkit/jar.mn
===================================================================
RCS file: /cvsroot/mozilla/toolkit/jar.mn,v
retrieving revision 1.30
diff -u -w -r1.30 jar.mn
--- toolkit/jar.mn	23 Apr 2003 19:07:28 -0000	1.30
+++ toolkit/jar.mn	24 May 2003 01:57:08 -0000
@@ -1,5 +1,5 @@
 toolkit.jar:
-+        content/global/xul.css                             (content/xul.css)
+*+       content/global/xul.css                             (content/xul.css)
 +        content/global/globalOverlay.js                    (content/globalOverlay.js)
 *+       content/global/finddialog.xul                      (content/finddialog.xul)
 *+       content/global/finddialog.js                       (content/finddialog.js)
Index: toolkit/components/Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/toolkit/components/Makefile.in,v
retrieving revision 1.4
diff -u -w -r1.4 Makefile.in
--- toolkit/components/Makefile.in	2 Mar 2003 21:10:33 -0000	1.4
+++ toolkit/components/Makefile.in	24 May 2003 01:57:08 -0000
@@ -5,6 +5,11 @@
 
 include $(DEPTH)/config/autoconf.mk
 
+ifdef MOZ_THUNDERBIRD
+DIRS = console
+else
 DIRS = autocomplete console filepicker history satchel viewsource build
+endif
+
 
 include $(topsrcdir)/config/rules.mk
Index: toolkit/content/finddialog.js
===================================================================
RCS file: /cvsroot/mozilla/toolkit/content/finddialog.js,v
retrieving revision 1.4
diff -u -w -r1.4 finddialog.js
--- toolkit/content/finddialog.js	11 Oct 2002 01:27:27 -0000	1.4
+++ toolkit/content/finddialog.js	24 May 2003 01:57:08 -0000
@@ -28,6 +28,7 @@
 
 var dialog;     // Quick access to document/form elements.
 var gFindInst;   // nsIWebBrowserFind that we're going to use
+var gFindInstData; // use this to update the find inst data
 
 function initDialogObject()
 {
@@ -87,10 +88,15 @@
   initDialogObject();
 
   // get the find instance
-  var finder = window.arguments[0];
+  var arg0 = window.arguments[0]; 
+  if (arg0 instanceof window.opener.nsFindInstData) { 
+    gFindInstData = arg0;
+    gFindInst = gFindInstData.webBrowserFind;
+  } else {
   // If the dialog was opened from window.find(), findInst will be an
-  // nsISupports interface, so QueryInterface anyway to nsIWebBrowserFind.
-  gFindInst = finder.QueryInterface(Components.interfaces.nsIWebBrowserFind);
+    // nsISupports interface, so QueryInterface anyway to nsIWebBrowserFind
+    gFindInst = arg0.QueryInterface(Components.interfaces.nsIWebBrowserFind);
+  }
 
   fillDialog();
   doEnabling();
@@ -107,6 +113,12 @@
 
 function onAccept()
 {
+  if (gFindInstData && gFindInst != gFindInstData.webBrowserFind) 
+  {
+    gFindInstData.init();
+    gFindInst = gFindInstData.webBrowserFind;
+  } 
+    
   // Transfer dialog contents to the find service.
   saveFindData();
 
Index: toolkit/content/xul.css
===================================================================
RCS file: /cvsroot/mozilla/toolkit/content/xul.css,v
retrieving revision 1.22
diff -u -w -r1.22 xul.css
--- toolkit/content/xul.css	22 Nov 2002 08:22:57 -0000	1.22
+++ toolkit/content/xul.css	24 May 2003 01:57:08 -0000
@@ -644,6 +644,38 @@
 
 /********** autocomplete textbox **********/
 
+/* thunderbird doesn't use the new toolkit's autocomplete widget yet.... */
+#ifdef MOZ_THUNDERBIRD
+
+textbox[type="autocomplete"] {
+  -moz-binding: url("chrome://global/content/autocomplete.xml#autocomplete");
+}
+
+.autocomplete-result-popup {
+  -moz-binding: url("chrome://global/content/autocomplete.xml#autocomplete-result-popup");
+}
+
+.autocomplete-history-popup {
+  -moz-binding: url("chrome://global/content/autocomplete.xml#autocomplete-history-popup");
+}
+
+.autocomplete-tree {
+  -moz-binding: url("chrome://global/content/autocomplete.xml#autocomplete-tree");
+}
+
+.autocomplete-treebody {
+  -moz-binding: url("chrome://global/content/autocomplete.xml#autocomplete-treebody");
+}
+
+.autocomplete-treerows {
+  -moz-binding: url("chrome://global/content/autocomplete.xml#autocomplete-treerows");
+}
+
+.autocomplete-history-dropmarker {
+  -moz-binding: url("chrome://global/content/autocomplete.xml#history-dropmarker");
+}
+
+#else
 
 textbox[type="autocomplete"] {
   -moz-binding: url("chrome://global/content/widgets/autocomplete.xml#autocomplete");
@@ -674,6 +706,10 @@
   display: -moz-box;
   -moz-binding: url("chrome://global/content/widgets/autocomplete.xml#history-dropmarker");
 }
+
+#endif
+
+
 
 /* the C++ implementation of widgets is too eager to make popups visible.
    this causes problems (bug 120155 and others), thus this workaround: */
Index: toolkit/content/widgets/checkbox.xml
===================================================================
RCS file: /cvsroot/mozilla/toolkit/content/widgets/checkbox.xml,v
retrieving revision 1.2
diff -u -w -r1.2 checkbox.xml
--- toolkit/content/widgets/checkbox.xml	11 Nov 2002 01:51:49 -0000	1.2
+++ toolkit/content/widgets/checkbox.xml	24 May 2003 01:57:08 -0000
@@ -14,9 +14,9 @@
   <binding id="checkbox-baseline" extends="chrome://global/content/bindings/general.xml#basetext">
     <content>
       <xul:image class="checkbox-check" xbl:inherits="checked,disabled"/>
-      <xul:hbox class="checkbox-label-box" xbl:inherits="flex">
+      <xul:hbox class="checkbox-label-box" flex="1">
         <xul:image class="checkbox-icon" xbl:inherits="src"/>
-        <xul:label class="checkbox-label" xbl:inherits="flex,xbl:text=label,accesskey,crop"/>
+        <xul:label class="checkbox-label" xbl:inherits="xbl:text=label,accesskey,crop" flex="1"/>
       </xul:hbox>
     </content>
     
Index: toolkit/skin/win/autocomplete.css
===================================================================
RCS file: /cvsroot/mozilla/toolkit/skin/win/autocomplete.css,v
retrieving revision 1.8
diff -u -w -r1.8 autocomplete.css
--- toolkit/skin/win/autocomplete.css	11 Oct 2002 10:07:59 -0000	1.8
+++ toolkit/skin/win/autocomplete.css	24 May 2003 01:57:08 -0000
@@ -115,6 +115,19 @@
   color: HighlightText !important;
 }
 
+/* thunderbird does not use the new autocomplete widget yet so we need a couple of the old styles rules for it */
+
+#ifdef MOZ_THUNDERBIRD
+.autocomplete-treebody:-moz-tree-row(menuactive) {
+  background-color: Highlight;
+}
+
+.autocomplete-treebody:-moz-tree-cell-text(menuactive)  {
+  color: HighlightText !important;
+}
+
+#endif
+
 /* ::::: textboxes inside toolbarpaletteitems ::::: */
 
 toolbarpaletteitem > toolbaritem > textbox > hbox > hbox > html|*.textbox-input {
Index: toolkit/skin/win/jar.mn
===================================================================
RCS file: /cvsroot/mozilla/toolkit/skin/win/jar.mn,v
retrieving revision 1.18
diff -u -w -r1.18 jar.mn
--- toolkit/skin/win/jar.mn	25 Apr 2003 08:15:21 -0000	1.18
+++ toolkit/skin/win/jar.mn	24 May 2003 01:57:08 -0000
@@ -1,5 +1,5 @@
 classic.jar:
-+  skin/classic/global/autocomplete.css
+*+ skin/classic/global/autocomplete.css
 +  skin/classic/global/browser.css
 +  skin/classic/global/checkbox.css
 +  skin/classic/global/colorpicker.css

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#196297; Package patch. Full text and rfc822 format available.

Acknowledgement sent to Michael Fedrowitz <michaelf@debian.org>:
Extra info received and forwarded to list. Full text and rfc822 format available.

Message #10 received at 196297@bugs.debian.org (full text, mbox):

From: Michael Fedrowitz <michaelf@debian.org>
To: bug-patch@gnu.org, André Dahlqvist <anedah-9@student.luth.se>, 196297@bugs.debian.org
Subject: Re: Bug#196297: Patch rejected with patch 2.5.9-1
Date: Fri, 6 Jun 2003 18:56:10 +0200
retitle 196297 patch: CR stripping broken for unified diffs
tags 196297 + upstream
forwarded 196297 bug-patch@gnu.org
thanks

On Fri, Jun 06, 2003 at 12:16:57AM +0200, André Dahlqvist wrote:

 Hi,

> After doing my last upgrade of Sid I cannot apply a patch to Mozilla 
> Thunderbird which I have always been able to. If I downgrade to patch 
> 2.5.4-11 the same patch file can be applied. The previous version of 
> patch that I had must have been 2.5.8-2 and that also worked.
[...]

> Is it possible that the new version of patch has broken handling of 
> trailing CR:s?

Yes, for unified diffs.

Looks like p_strip_trailing_cr never gets set for unified diffs. The
patch below fixes this for me, but there may very well be a better place
to do this (just not in the diff_type == UNI_DIFF block, because then
the problem with diff -F would be back).

> I have attached the patch file itself also.

Um, the patch you attached doesn't have any CRs; maybe your MUA stripped
them off. So I can't say for sure if this will fix your problem (there
are cases where patch is supposed to leave the CRs in).

-Michael


diff -urN patch-2.5.9.orig/pch.c patch-2.5.9/pch.c
--- patch-2.5.9.orig/pch.c	2003-05-20 16:03:17.000000000 +0200
+++ patch-2.5.9/pch.c	2003-06-06 17:18:25.000000000 +0200
@@ -365,9 +365,11 @@
 	}
 	if (!stars_last_line && strnEQ(s, "*** ", 4))
 	    name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
-	else if (strnEQ(s, "+++ ", 4))
+	else if (strnEQ(s, "+++ ", 4)) {
 	    /* Swap with NEW below.  */
 	    name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
+	    p_strip_trailing_cr = strip_trailing_cr;
+	}
 	else if (strnEQ(s, "Index:", 6))
 	    name[INDEX] = fetchname (s+6, strippath, (time_t *) 0);
 	else if (strnEQ(s, "Prereq:", 7)) {



Changed Bug title. Request was from Michael Fedrowitz <michaelf@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Tags added: upstream Request was from Michael Fedrowitz <michaelf@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Noted your statement that Bug has been forwarded to bug-patch@gnu.org. Request was from Michael Fedrowitz <michaelf@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Reply sent to Michael Fedrowitz <michaelf@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to André Dahlqvist <anedah-9@student.luth.se>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #21 received at 196297-close@bugs.debian.org (full text, mbox):

From: Michael Fedrowitz <michaelf@debian.org>
To: 196297-close@bugs.debian.org
Subject: Bug#196297: fixed in patch 2.5.9-2
Date: Sun, 18 Jul 2004 07:47:07 -0400
Source: patch
Source-Version: 2.5.9-2

We believe that the bug you reported is fixed in the latest version of
patch, which is due to be installed in the Debian FTP archive:

patch_2.5.9-2.diff.gz
  to pool/main/p/patch/patch_2.5.9-2.diff.gz
patch_2.5.9-2.dsc
  to pool/main/p/patch/patch_2.5.9-2.dsc
patch_2.5.9-2_i386.deb
  to pool/main/p/patch/patch_2.5.9-2_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 196297@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Fedrowitz <michaelf@debian.org> (supplier of updated patch package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 18 Jul 2004 12:56:02 +0200
Source: patch
Binary: patch
Architecture: source i386
Version: 2.5.9-2
Distribution: unstable
Urgency: low
Maintainer: Michael Fedrowitz <michaelf@debian.org>
Changed-By: Michael Fedrowitz <michaelf@debian.org>
Description: 
 patch      - Apply a diff file to an original
Closes: 196297 248950
Changes: 
 patch (2.5.9-2) unstable; urgency=low
 .
   * Standards-Version 3.6.1 (no changes required).
   * Applied upstream patch to fix CR stripping. (Closes: #196297)
   * Applied a patch from SUSE to prevent previously created backup files
     from being overwritten. (Closes: #248950)
   * Ran aclocal and autoconf to make the above patch work.
   * Touch aclocal.m4 and configure during build to prevent the usual
     time-skew problems.
   * Removed emacs vars from changelog.
Files: 
 fe4123c14efaed2bc590e3eae3873f82 564 utils standard patch_2.5.9-2.dsc
 fe3bdcc4fefc78c8b767845bb56871fc 49672 utils standard patch_2.5.9-2.diff.gz
 e2c38aa15a362a691a1d7b0a70e82798 96436 utils standard patch_2.5.9-2_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA+lflvpyGjQRgTrgRAlcsAJ0UYP5o8ZJUwqrfFptsam3HY6B08gCfZtX+
j0mpaZaYtCh/O2c4ABvaAR4=
=PPrv
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 07:48:43 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.