gnats-prs
[Top][All Lists]
Advanced

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

gnats/598: Re: gnats/598


From: bug-gnats
Subject: gnats/598: Re: gnats/598
Date: Fri, 28 Apr 2006 16:45:01 -0500 (CDT)

The following reply was made to PR gnats/598; it has been noted by GNATS.

From: Michael van Elst <address@hidden>
To: address@hidden
Cc: 
Subject: Re: gnats/598
Date: Fri, 28 Apr 2006 23:39:47 +0200

 --1yeeQ81UyVL57Vl7
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 
 Here is the diff.
 
 -- 
                                 Michael van Elst
 Internet: address@hidden
                                 "A potential Snark may lurk in every tree."
 
 --1yeeQ81UyVL57Vl7
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="diff-prs.diff"
 
 --- /usr/pkg/libexec/gnats/diff-prs.org        2005-09-03 16:52:36.000000000 
+0000
 +++ diff-prs   2006-04-28 21:10:42.000000000 +0000
 @@ -25,6 +25,7 @@
  /usr/bin/awk '
  BEGIN {
    state = 0;
 +  nlines = 0;
  }
  
  (state == 0) {
 @@ -49,20 +50,35 @@
    sub(":.*$", "", fieldname);
    sub("^[^:]*:[ \t]*", "", line);
    arrayindex=state">"fieldname;
 -  array[arrayindex] = line;
 +  nlines++;
 +  numlines[arrayindex] = 1;
 +  array[arrayindex] = nlines;
 +  linebuf[nlines] = line;
    fields[fieldname]++;
    next;
  }
  
  ((state == 1 || state == 3) && arrayindex != "") {
 -  array[arrayindex] = array[arrayindex] "" $0;
 +  nlines++;
 +  numlines[arrayindex]++;
 +  linebuf[nlines] = $0;
    next;
  }
  
  END {
    for (x in fields) {
 -    if (array["1>"x] != array["3>"x]) {
 +    if (numlines["1>"x] != numlines["3>"x]) {
        print x;
 +    } else {
 +      u=array["1>"x];
 +      v=array["3>"x];
 +      n=numlines["1>"x];
 +      for (i=0; i<n; ++i) {
 +      if (linebuf[u+i] != linebuf[v+i]) {
 +          print x;
 +          break;
 +        }
 +      }
      }
    }
  }
 
 --1yeeQ81UyVL57Vl7--
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]