bug-ed
[Top][All Lists]
Advanced

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

[Bug-ed] [patch] proposal: adding '^' address


From: Juan Lasca
Subject: [Bug-ed] [patch] proposal: adding '^' address
Date: Mon, 30 Nov 2015 14:09:54 -0300

Hi,
As suggested by Tim Chase, it seems like a good idea to add the '^' address
to GNU ed, to improve compatibility with other implementations.

The following is a list of UNIX-like operating systems and links to the source
code of their `ed' implementation. Where source is unavailable, a link to the
corresponding manual page is provided, in which the presence of the
feature is documented.

FreeBSD      
https://svnweb.freebsd.org/base/stable/10/bin/ed/main.c?view=markup#l293
NetBSD       
http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/ed/main.c?only_with_tag=MAIN
OpenBSD      http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/ed/main.c
DragonFlyBSD 
http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/bin/ed/main.c
IllumOS      
http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/ed/ed.c#981
MirOS        
https://www.mirbsd.org/cvs.cgi/~checkout~/src/bin/ed/main.c?rev=1.9;content-type=text%2Fplain
IRIX         
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/u_man/cat1/ed.z&srch=ed
Minix        
http://git.minix3.org/index.cgi?p=minix.git;a=blob;f=bin/ed/main.c;h=a9a7727002376d51302ecd5da5db2ba3ead5dc4f;hb=HEAD
Plan 9       http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/ed.c
LSX          http://minnie.tuhs.org/cgi-bin/utree.pl?file=LSX/src/ed.c
(incomplete source ?)
UNIX V7      http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/ed.c
UNIX V6      http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/s1/ed.c
UnixWare 7   http://osr507doc.sco.com/en/man/html.C/ed.C.html
Ultrix 8     http://www.unix.com/man-page/ultrix/1/ed/

It would be easy to add this feature to GNU ed, just by changing in
file main_loop.c

- const unsigned char ch = **ibufpp;
+ const unsigned char ch = ( **ibufpp == '^' ? '-' : **ibufpp );

or by applying the patch attached.
The patch also adds the `addr3' test to the testsuite.
A separate patch is attached to change the documentation properly.
Changes passed `make check' successfully.

Regards,
Juan.

Attachment: code_and_test.patch
Description: Binary data

Attachment: documentation.patch
Description: Binary data


reply via email to

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