Summary: | Method extractPair(String, char, int[]) in Patcher.java fails on single number in range | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Martin Burger <m> | ||||
Component: | Compare | Assignee: | Andre Weinand <andre_weinand> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 3.0.2 | ||||||
Target Milestone: | 3.1 M7 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Martin Burger
2005-05-05 12:27:47 EDT
Created attachment 20746 [details]
Patch for Patcher.java
This patch swaps the two assignments of pair.
Thanks for the patch! However, I'm somewhat reluctant to use it because I have yet to find the part of the specification saying that "If the length is 1, then only the start value is included in the header". BTW, my code } else { pair[1]= Integer.parseInt(line.substring(comma+1)) works only by accident because the value of comma happens to be -1 in the else case, which results in a line.substring(-1+1) This is not wrong but slightly bogus... Do you know how to create a patch that uses the "@@ -5 +5 @@" syntax? Take a file with one changed line. Create an unified diff with no context lines as follows: # diff -U 0 orig_short.txt changed_short.txt --- orig_short.txt Fri May 6 01:46:07 2005 +++ changed_short.txt Fri May 6 14:44:19 2005 @@ -5 +5 @@ -[5] amet, +[5] amet, CHANGED LINE The "specification" can be found in the source code of the Diffutils: File: diffutils-2.8.1/src/context.c Function: print_unidiff_number_range Line: 274 fprintf (outfile, trans_b < trans_a ? "%ld,0" : "%ld", trans_b); released patch for N20050507 |