[bug #24906] Can't parse unified diff header, occurence of /^---/



URL:
  <http://savannah.gnu.org/bugs/?24906>

                 Summary: Can't parse unified diff header, occurence of
/^---/
                 Project: GNU Midnight Commander
            Submitted by: hrazdii
            Submitted on: So 23 Nov 2008 09:59:26 CET
                Category: None
                Severity: 3 - Normal
                 Release: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Problem: In my patch file is "---" on the beginning of line.

For better explanation i was changed my patchfs script:
# diff patchfs_ patchfs
142c142
<       error "Can't parse unified diff header"
---
>       error "Can't parse unified diff header >>$$buf<<"

The script output is:
$ /usr/share/mc/extfs/patchfs list adonis.patch.bz2
-rw-r--r-- 1 igor igor 566 02-09-2008 04:00
adonis/bin/adv_sugg_maintain.sh.diff
-rw-r--r-- 1 igor igor 1936 09-05-2008 23:52 adonis/bin/archiv.sh.diff
Can't parse unified diff header >>--- where ar.last_update >= "2008-09-25"
-group by 1,2
-order by 1,2;
<<

In one of original data file is line with "--" (a sql comment without blank
space on the bebinning):
-- where ar.last_update >= "2008-09-25"


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: So 23 Nov 2008 09:59:26 CET   By: Benjamin Wolsey <bwy>
This item has been reassigned from the project Gnash - The GNU Flash player
bugs tracker to your tracker.

The original report is still available at bugs #24885

Following are the information included in the original report:

[field #0]                  Item ID: 24885<br />[field #1]                
Group ID: 8191<br />[field #2]              Open/Closed: Open<br />[field #3] 
               Severity: 3 - Normal<br />[field #4]                  Privacy:
Public<br />[field #8]                         : Unknown bugs Field Display
Type<br />[field #9]                 Category: utilities<br />[field #10]     
       Submitted by: hrazdii<br />[field #11]              Assigned to:
None<br />[field #12]             Submitted on: Do 20 Nov 2008 06:17:52 CET<br
/>[field #13]                  Summary: Can't parse unified diff header,
occurence of /^---/<br />[field #14]      Original Submission: Problem: In my
patch file is "---" on the beginning of line.

For better explanation i was changed my patchfs script:
# diff patchfs_ patchfs
142c142
<       error "Can't parse unified diff header"
---
>       error "Can't parse unified diff header >>$$buf<<"

The script output is:
$ /usr/share/mc/extfs/patchfs list adonis.patch.bz2
-rw-r--r-- 1 igor igor 566 02-09-2008 04:00
adonis/bin/adv_sugg_maintain.sh.diff
-rw-r--r-- 1 igor igor 1936 09-05-2008 23:52 adonis/bin/archiv.sh.diff
Can't parse unified diff header >>--- where ar.last_update >= "2008-09-25"
-group by 1,2
-order by 1,2;
<<

In one of original data file is line with "--" (a sql comment without blank
space on the bebinning):
-- where ar.last_update >= "2008-09-25"
<br />[field #16]               Item Group: None<br />[field #17]            
      Status: None<br />[field #18]        Component Version: None<br />[field
#19]         Operating System: None<br />[field #20]          Reproducibility:
None<br />[field #21]               Size (loc): None<br />[field #22]         
  Fixed Release: None<br />[field #23]          Planned Release: None<br
/>[field #24]                   Effort: 0.00<br />[field #28]                
Priority: 5 - Normal<br />[field #31]         Percent Complete: 0%<br />[field
#33]                  Release: None<br />[field #58]     Custom Select Box #1:
None<br />[field #59]     Custom Select Box #2: None<br />[field #60]    
Custom Select Box #3: None<br />[field #61]     Custom Select Box #4: None<br
/>[field #62]     Custom Select Box #5: None<br />[field #63]     Custom
Select Box #6: None<br />[field #64]     Custom Select Box #7: None<br
/>[field #65]     Custom Select Box #8: None<br />[field #66]     Custom
Select Box #9: None<br />[field #67]    Custom Select Box #10: None<br />

-------------------------------------------------------
Date: So 23 Nov 2008 09:59:23 CET   By: Benjamin Wolsey <bwy>
Looks like one of your bugs has got lost, mc. Greetings from the Gnash team.

-------------------------------------------------------
Date: Do 20 Nov 2008 08:12:46 CET   By: Benjamin Wolsey <bwy>
What is this about, please?

-------------------------------------------------------
Date: Do 20 Nov 2008 07:47:36 CET   By: Igor Hrazdil <hrazdii>
a clumsy single-purpose patch is:

--- patchfs_    2008-11-20 06:07:51.000000000 +0100
+++ patchfs     2008-11-20 07:42:18.000000000 +0100
@@ -10,6 +10,7 @@
 use strict;
 use POSIX;
 use File::Temp 'tempfile';
+use IO::Handle;

 # standard binaries
 my $bzip = 'bzip2';
@@ -149,6 +150,15 @@
     }
 }

+sub _b
+{
+       my ($buf, $c)= _;
+       return if $$buf !~ /^--- /;
+       $c = IO::Handle::getc(*I);
+       IO::Handle::ungetc(*I, ord($c));
+       return 1 if ord($c) == 43;      # ord("+")
+}
+
 # list files affected by patch
 sub list
 {
@@ -168,7 +178,7 @@

        # recognize diff type
        if (!$unified && !$context) {
-           $unified=1 if (/^--- /);
+           $unified=1 if _b(\$_);
            $context=1 if (/^\*\*\* /);
            if (!$unified && !$context) {
                $len+=length;
@@ -176,7 +186,7 @@
            }
        }

-       if (($unified && /^--- /) || ($context && /^\*\*\* [^\*]*$/)) {
+       if (($unified && _b(\$_)) || ($context && /^\*\*\* [^\*]*$/)) {
            # start of new file
            if ($state==1) {
                printf "-rw-r--r-- 1 %s %s %d %s %s%s\n", $uid, $gid, $len,
datetime($time), $prefix, $f


-------------------------------------------------------
Date: Do 20 Nov 2008 06:23:21 CET   By: Igor Hrazdil <hrazdii>
I forget, the patchfs script version is 1.17:
http://cvs.savannah.gnu.org/viewvc/mc/vfs/extfs/patchfs.in?revision=1.17&root=mc&view=markup


-------------------------------------------------------
Date: So 23 Nov 2008 09:59:26 CET   By: Igor Hrazdil <hrazdii>
Problem: In my patch file is "---" on the beginning of line.

For better explanation i was changed my patchfs script:
# diff patchfs_ patchfs
142c142
<       error "Can't parse unified diff header"
---
>       error "Can't parse unified diff header >>$$buf<<"

The script output is:
$ /usr/share/mc/extfs/patchfs list adonis.patch.bz2
-rw-r--r-- 1 igor igor 566 02-09-2008 04:00
adonis/bin/adv_sugg_maintain.sh.diff
-rw-r--r-- 1 igor igor 1936 09-05-2008 23:52 adonis/bin/archiv.sh.diff
Can't parse unified diff header >>--- where ar.last_update >= "2008-09-25"
-group by 1,2
-order by 1,2;
<<

In one of original data file is line with "--" (a sql comment without blank
space on the bebinning):
-- where ar.last_update >= "2008-09-25"







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24906>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]