FreeBSD Bugzilla – Attachment 144995 Details for
Bug 192108
[patch] sed(1) bug in "addr1,+N" ranges
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix sed relative address
sed_fix_and_untangle.diff (text/plain), 2.06 KB, created by
Jeremie Le Hen
on 2014-07-26 08:55:27 UTC
(
hide
)
Description:
Fix sed relative address
Filename:
MIME Type:
Creator:
Jeremie Le Hen
Created:
2014-07-26 08:55:27 UTC
Size:
2.06 KB
patch
obsolete
>Index: process.c >=================================================================== >--- process.c (revision 269092) >+++ process.c (working copy) >@@ -288,24 +288,32 @@ > r = 1; > else if (cp->a2) > if (cp->startline > 0) { >- if (MATCH(cp->a2)) { >- cp->startline = 0; >- lastaddr = 1; >- r = 1; >- } else if (linenum - cp->startline <= cp->a2->u.l) >- r = 1; >- else if ((cp->a2->type == AT_LINE && >- linenum > cp->a2->u.l) || >- (cp->a2->type == AT_RELLINE && >- linenum - cp->startline > cp->a2->u.l)) { >- /* >- * We missed the 2nd address due to a branch, >- * so just close the range and return false. >- */ >- cp->startline = 0; >- r = 0; >- } else >- r = 1; >+ switch (cp->a2->type) { >+ case AT_RELLINE: >+ if (linenum - cp->startline <= cp->a2->u.l) >+ r = 1; >+ else { >+ cp->startline = 0; >+ r = 0; >+ } >+ break; >+ default: >+ if (MATCH(cp->a2)) { >+ cp->startline = 0; >+ lastaddr = 1; >+ r = 1; >+ } else if (cp->a2->type == AT_LINE && >+ linenum > cp->a2->u.l) { >+ /* >+ * We missed the 2nd address due to a >+ * branch, so just close the range and >+ * return false. >+ */ >+ cp->startline = 0; >+ r = 0; >+ } else >+ r = 1; >+ } > } else if (MATCH(cp->a1)) { > /* > * If the second address is a number less than or
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 192108
:
144962
| 144995