Re: ed(1) doesn't support adress ranges which begin with comma or semicolon
Theo Buehler wrote: > On Sat, Dec 24, 2016 at 10:45:16PM +0100, Theo Buehler wrote: > > On Sat, Dec 24, 2016 at 05:44:07PM +0100, Jérôme FRGACIC wrote: > > > Hi @tech, > > > > > > I remark that ed(1) do not support adress ranges which begin with > > > comma or semicolon, for example ",10p" which is equivalent to "1,10p" or > > > "; +10p" which is equivalent to ".;+10p". These adress ranges are > > > specified by Open Group Base Specifications Issue 6 (IEEE Std 1003.1, > > > 2004 Edition) (in fact, there are also adress ranges like "10," which > > > is equivalent to "10,10" but they seem useless to me...). > > > > > > I would suggest this diff to add support for these adress ranges. > > > > ok tb@ > > anyone willing to commit this or give another ok? Looks good to me. ok stefan@ > > > > > Index: main.c > > > === > > > RCS file: /cvs/src/bin/ed/main.c,v > > > retrieving revision 1.58 > > > diff -u -r1.58 main.c > > > --- main.c16 Aug 2016 20:04:46 - 1.58 > > > +++ main.c24 Dec 2016 15:26:41 - > > > @@ -383,7 +383,9 @@ > > > ibufp++; > > > addr_cnt++; > > > second_addr = (c == ';') ? > > > current_addr : 1; > > > - addr = addr_last; > > > + addr = next_addr(); > > > + if (addr < 0) > > > + addr = addr_last; > > > break; > > > } > > > /* FALLTHROUGH */ > > > > > > PS : I haven't subcribe to the tech mailing list, so please add me as > > > recipient if you reply. > > > PPS : Merry Christmas. > > > > > > > > > Kind regards, > > > > > > > > > Jérôme FRGACIC > > > > > >
Re: ed(1) doesn't support adress ranges which begin with comma or semicolon
On Sat, Dec 24, 2016 at 10:45:16PM +0100, Theo Buehler wrote: > On Sat, Dec 24, 2016 at 05:44:07PM +0100, Jérôme FRGACIC wrote: > > Hi @tech, > > > > I remark that ed(1) do not support adress ranges which begin with > > comma or semicolon, for example ",10p" which is equivalent to "1,10p" or > > "; +10p" which is equivalent to ".;+10p". These adress ranges are > > specified by Open Group Base Specifications Issue 6 (IEEE Std 1003.1, > > 2004 Edition) (in fact, there are also adress ranges like "10," which > > is equivalent to "10,10" but they seem useless to me...). > > > > I would suggest this diff to add support for these adress ranges. > > ok tb@ anyone willing to commit this or give another ok? > > > Index: main.c > > === > > RCS file: /cvs/src/bin/ed/main.c,v > > retrieving revision 1.58 > > diff -u -r1.58 main.c > > --- main.c 16 Aug 2016 20:04:46 - 1.58 > > +++ main.c 24 Dec 2016 15:26:41 - > > @@ -383,7 +383,9 @@ > > ibufp++; > > addr_cnt++; > > second_addr = (c == ';') ? > > current_addr : 1; > > - addr = addr_last; > > + addr = next_addr(); > > + if (addr < 0) > > + addr = addr_last; > > break; > > } > > /* FALLTHROUGH */ > > > > PS : I haven't subcribe to the tech mailing list, so please add me as > > recipient if you reply. > > PPS : Merry Christmas. > > > > > > Kind regards, > > > > > > Jérôme FRGACIC > > >
Re: ed(1) doesn't support adress ranges which begin with comma or semicolon
On Sat, Dec 24, 2016 at 05:44:07PM +0100, Jérôme FRGACIC wrote: > Hi @tech, > > I remark that ed(1) do not support adress ranges which begin with > comma or semicolon, for example ",10p" which is equivalent to "1,10p" or > "; +10p" which is equivalent to ".;+10p". These adress ranges are > specified by Open Group Base Specifications Issue 6 (IEEE Std 1003.1, > 2004 Edition) (in fact, there are also adress ranges like "10," which > is equivalent to "10,10" but they seem useless to me...). > > I would suggest this diff to add support for these adress ranges. ok tb@ > Index: main.c > === > RCS file: /cvs/src/bin/ed/main.c,v > retrieving revision 1.58 > diff -u -r1.58 main.c > --- main.c16 Aug 2016 20:04:46 - 1.58 > +++ main.c24 Dec 2016 15:26:41 - > @@ -383,7 +383,9 @@ > ibufp++; > addr_cnt++; > second_addr = (c == ';') ? > current_addr : 1; > - addr = addr_last; > + addr = next_addr(); > + if (addr < 0) > + addr = addr_last; > break; > } > /* FALLTHROUGH */ > > PS : I haven't subcribe to the tech mailing list, so please add me as > recipient if you reply. > PPS : Merry Christmas. > > > Kind regards, > > > Jérôme FRGACIC >
ed(1) doesn't support adress ranges which begin with comma or semicolon
Hi @tech, I remark that ed(1) do not support adress ranges which begin with comma or semicolon, for example ",10p" which is equivalent to "1,10p" or "; +10p" which is equivalent to ".;+10p". These adress ranges are specified by Open Group Base Specifications Issue 6 (IEEE Std 1003.1, 2004 Edition) (in fact, there are also adress ranges like "10," which is equivalent to "10,10" but they seem useless to me...). I would suggest this diff to add support for these adress ranges. Index: main.c === RCS file: /cvs/src/bin/ed/main.c,v retrieving revision 1.58 diff -u -r1.58 main.c --- main.c 16 Aug 2016 20:04:46 - 1.58 +++ main.c 24 Dec 2016 15:26:41 - @@ -383,7 +383,9 @@ ibufp++; addr_cnt++; second_addr = (c == ';') ? current_addr : 1; - addr = addr_last; + addr = next_addr(); + if (addr < 0) + addr = addr_last; break; } /* FALLTHROUGH */ PS : I haven't subcribe to the tech mailing list, so please add me as recipient if you reply. PPS : Merry Christmas. Kind regards, Jérôme FRGACIC