Bug 431887 - Cannot handle file names with integrated spaces
Cannot handle file names with integrated spaces
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: patch (Show other bugs)
5.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Tim Waugh
Ondrej Moriš
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-07 12:16 EST by Klaus Ethgen
Modified: 2013-04-12 15:31 EDT (History)
2 users (show)

See Also:
Fixed In Version: patch-2.5.4-30.el5
Doc Type: Bug Fix
Doc Text:
Patches for files whose names contain spaces could not be applied. A change has been backported to allow filenames with spaces.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-25 10:18:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch-allow-spaces.patch (588 bytes, patch)
2008-02-08 08:40 EST, Tim Waugh
no flags Details | Diff

  None (edit)
Description Klaus Ethgen 2008-02-07 12:16:31 EST
Description of problem:
If the file name for the file to be patched in a patch file has spaces, it
cannot be handled by patch.

Version-Release number of selected component (if applicable):
patch-2.5.4-29.2.2

How reproducible:
create a patch of a file with spaces in path
try to apply the patch

Actual results:
patch asks for the file name to patch

Expected results:
Just the patched file

Additional info:
Note that this bug is fixed upstream on 2003-05-18!
Comment 1 Tim Waugh 2008-02-07 12:40:55 EST
The most recent release of patch is 2.5.4, released in 1999.  Which upstream fix
are you referring to?
Comment 2 Klaus Ethgen 2008-02-07 13:06:03 EST
The most recent release I find ist 2.5.9 (ftp://alpha.gnu.org/gnu/diffutils/) 
from 2004-06-01.
Comment 3 Tim Waugh 2008-02-07 18:05:28 EST
We don't generally ship pre-release software, and 2.5.9 is not a "stable"
release (hence it being hosted on alpha.gnu.org not ftp.gnu.org).

I'll take a look at the file names change there.
Comment 4 Tim Waugh 2008-02-08 08:40:27 EST
Created attachment 294351 [details]
patch-allow-spaces.patch

Patch is simple and non-invasive.
Comment 5 Tim Waugh 2008-02-08 08:41:23 EST
Klaus: thanks for pointing out this fix.
Comment 7 Phil Knirsch 2008-04-30 11:55:26 EDT
Proposing for RHEL-5.3 and granting Devel ACK.

Read ya, Phil
Comment 9 RHEL Product and Program Management 2009-03-26 12:47:46 EDT
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 10 RHEL Product and Program Management 2009-11-06 13:42:48 EST
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 12 Tim Waugh 2010-08-06 12:50:30 EDT
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.

New Contents:
Patches for files whose names contain spaces could not be applied.  A change has been backported to allow filenames with spaces.
Comment 14 Ondrej Moriš 2010-08-24 05:37:13 EDT
I can reproduce this bug on patch-2.5.4-29.2.3.el5:

# cat patch1 
--- second 2010-08-24 05:17:56.000000000 -0400
+++ f i r s t 2010-08-24 05:17:44.000000000 -0400
@@ -1 +1 @@
-2nd
+1st

# patch second patch1
patching file second

# cat patch2
--- f i r s t 2010-08-24 05:17:44.000000000 -0400
+++ second 2010-08-24 05:17:56.000000000 -0400
@@ -1 +1 @@
-1st
+2nd

# patch f\ i\ r\ s\ t patch 
patching file 'f i r s t'

Could you please provide more specific reproducer?
Comment 15 Tim Waugh 2010-08-24 05:54:14 EDT
echo a > "file name.orig"
echo b > "file name"
diff -u "file name.orig" "file name" > fn.patch
rm "file name"*
echo a > "file name"
patch -i fn.patch
Comment 16 Ondrej Moriš 2010-08-24 06:27:47 EDT
Ah, great... thanks.
Comment 19 errata-xmlrpc 2010-08-25 10:18:39 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0656.html

Note You need to log in before you can comment on or make changes to this bug.