NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/54620: patch(1) has issues with long lines
>Number: 54620
>Category: bin
>Synopsis: patch(1) has issues with long lines
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Oct 16 09:40:00 +0000 2019
>Originator: coypu
>Release: NetBSD 9.99.15
>Organization:
>Environment:
NetBSD planets 9.99.15 NetBSD 9.99.15 (GENERIC) #1: Fri Oct 11 23:50:23 IDT 2019 fly@planets:/cvs/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
Unfortunately there's a very real scenario for this happening: trying to patch JSON files in pkgsrc.
It errors like:
patch: **** malformed patch at line 5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
>How-To-Repeat:
Here's a test case. It works if changing 10000s to 1000s.
#!/bin/sh
printf %10s |tr " " "a" > longlines 2>/dev/null
cat << EOF > longlines.patch
--- ./longlines.orig 2019-10-16 09:25:30.667656644 +0000
+++ ./longlines
@@ -1 +1 @@
EOF
printf -- "-"%10s"\n" |tr " " "a" >> longlines.patch 2>/dev/null
printf -- "+"%10s |tr " " "b" >> longlines.patch 2>/dev/null
patch longlines < longlines.patch
>Fix:
Home |
Main Index |
Thread Index |
Old Index