php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63697 'Download diff as a patch' doesn't consider trailing spaces changes
Submitted: 2012-12-05 12:17 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: shein@php.net Assigned:
Status: Closed Package: Online Doc Editor problem
PHP Version: Irrelevant OS: Ubuntu 12.10 64-bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shein@php.net
New email:
PHP Version: OS:

 

 [2012-12-05 12:17 UTC] shein@php.net
Description:
------------
The tool generates incorrect patches when patch contains lines that diff only in 
trailing spaces, for example, in this patch: https://edit.php.net/index.php?
patch=ru/features/cookies.xml&project=PHP

original line 
"когда включена директива <link linkend="ini.track-vars">track_vars</link>."
should contain trailing space, while patched line doesn't. As you can see in the 
patch lines are identical - this makes patch(1) reject these hunks.

In Expected/Actual result sections I enabled "End-of-line" mode, so it's easier 
to spot trailing spaces.

Expected result:
----------------
conf@conf ~/Downloads $ cat -E patch-1354692276.patch 
--- ru/features/cookies.xml$
+++ ru/features/cookies.xml$
@@ -1,6 +1,6 @@$
 <?xml version="1.0" encoding="utf-8"?>$
 <!-- EN-Revision: 297028 Maintainer: shein Status: ready -->$
-<!-- Reviewed: no -->$
+<!-- Reviewed: yes Maintainer: Alex Cooper -->$
 <!-- $Revision: 325754 $ -->$
  <chapter xml:id="features.cookies" xmlns="http://docbook.org/ns/docbook">$
   <title>Cookies</title>$
@@ -35,7 +35,7 @@$
    эту возможность, так как она обычно отключена в целях безопасности.$
    В более ранних версиях также определяется массив$
    <varname>$HTTP_COOKIE_VARS</varname>, но только$
-   когда включена директива <link linkend="ini.track-vars">track_vars</link>. $
+   когда включена директива <link linkend="ini.track-vars">track_vars</link>.$
    (Эта директива всегда включена начиная с версии PHP 4.0.3.)$
   </para>$


Actual result:
--------------
conf@conf ~/Downloads $ cat -E patch-1354692276.patch 
--- ru/features/cookies.xml$
+++ ru/features/cookies.xml$
@@ -1,6 +1,6 @@$
 <?xml version="1.0" encoding="utf-8"?>$
 <!-- EN-Revision: 297028 Maintainer: shein Status: ready -->$
-<!-- Reviewed: no -->$
+<!-- Reviewed: yes Maintainer: Alex Cooper -->$
 <!-- $Revision: 325754 $ -->$
  <chapter xml:id="features.cookies" xmlns="http://docbook.org/ns/docbook">$
   <title>Cookies</title>$
@@ -35,7 +35,7 @@$
    эту возможность, так как она обычно отключена в целях безопасности.$
    В более ранних версиях также определяется массив$
    <varname>$HTTP_COOKIE_VARS</varname>, но только$
-   когда включена директива <link linkend="ini.track-vars">track_vars</link>.$
+   когда включена директива <link linkend="ini.track-vars">track_vars</link>.$
    (Эта директива всегда включена начиная с версии PHP 4.0.3.)$
   </para>$


Patches

exec-to-passthru (last revision 2012-12-25 14:05 UTC by shein@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-25 14:05 UTC] shein@php.net
The following patch has been added/updated:

Patch Name: exec-to-passthru
Revision:   1356444345
URL:        https://bugs.php.net/patch-display.php?bug=63697&patch=exec-to-passthru&revision=1356444345
 [2012-12-25 14:07 UTC] shein@php.net
Comment to exec-to-passthru patch:
I've changed implementation of SaferExec::execMulti from exec() to ob_start() + 
passthru(), since exec() 
trims trailing spaces as noted in http://php.net/manual/en/function.exec.php.
 [2012-12-26 20:42 UTC] yannick@php.net
Automatic comment on behalf of yannick.torres@gmail.com
Revision: http://git.php.net/?p=web/doc-editor.git;a=commit;h=14709162d86939d9d28bf26063daf5fff1d8f1cf
Log: Fix bug #63697 ; Patch provided by shein@php.net. Thanks ;)
 [2012-12-26 20:42 UTC] yannick@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 02:01:28 2024 UTC