Patch cannot handle spaces in filenames

Bug #862280 reported by Maarten Bezemer
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
patch (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When there are spaces in a filename in a patch file, quilt is unable to properly apply the patch. See this patch file example:

--- a/foo bar/file.txt
+++ b/foo bar/file.txt
<rest of patch file>

The patch is applied on 'a/foo' instead of 'a/foo bar/file.txt'

Revision history for this message
Maarten Bezemer (veger) wrote :

I was too fast with my judgment, it seems that patch is unable to handle patch files with spaces in the file/path names

Revision history for this message
Maarten Bezemer (veger) wrote :

Problem lies at patch not at quilt

affects: quilt (Ubuntu) → patch (Ubuntu)
summary: - Quilt cannot handle spaces in filenames
+ Patch cannot handle spaces in filenames
Revision history for this message
Maarten Bezemer (veger) wrote :

When looking to fix this bug, I noticed in the patch code, that internal spaces (in the file name) are only allowed it the filename and date are separated by a \t (tab)

So by changing the patch file into:

--- a/foo bar/file.txt\t
 +++ b/foo bar/file.txt\t
 <rest of patch file>

(where \t is the actual tab)

fixes my problem.
As the code explicitly tells about the tab, I suppose this bug/problem will not be fixed...
(I added this comment to hopefully help others who are having problems with spaces in the file names)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in patch (Ubuntu):
status: New → Confirmed
Revision history for this message
i30817 (i30817) wrote :

10 years later, I still have to remember to add tabs manually every time i do a refresh from quilt. Is there any patch alternative i can install that is sane instead of insane about their precious purity of not using spaces in pathnames?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.