[PATCH] vi read-only mode bugfix and enhancement
Natanael Copa
natanael.copa at gmail.com
Wed Jul 18 02:24:36 PDT 2007
On Wed, 2007-07-18 at 09:41 +0200, Tito wrote:
> On Wednesday 18 July 2007 01:10:40 Denis Vlasenko wrote:
>
> > Applied to svn with minor changes. For example, we were comparing argv[0]
> > with "view", but argv[0] can be "/bin/view"! Right thing is
> >
> > strncmp(appliet_name, "view", 4)
>
> Why not:
> if (*applet_name[3])
>
> Just an idea....
Good idea!
Actually, none of those works atm. include/applets needs to be updated.
ln -s busybox vi
./vi
[vi starts as expected]
ln -s busybox view
./view
view: applet not found
ln -sf vi view
./view
view: applet not found
Attatched patch fixes this. However...
I believe most people uses 'less' nowdays so we migh just want to
drop /bin/view completely.
People who absolutely want 'view' can create an alias:
alias view='vi -R'
btw... help message needs -c option.
> Ciao,
> Tito
>
> > BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert
> > on vi...
> > --
> > vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vi-view.patch
Type: text/x-patch
Size: 1630 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070718/fbc2e440/attachment.bin
More information about the busybox
mailing list