The latest diff has no issues so far.
I just added the error message in case
execvp() fails.
Index: src/usr.bin/mg/dired.c
===
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.49
diff -u -p -r1.49 dired.c
--- src/usr.bin
> And here's that diff. [..]
It never hurts to re-read a diff before going to bed. Indeed, I
forgot to free argv (execlp uses alloca). The number of things
to clean up after one thing fails is almost getting out of hand,
and at least the fork() case wasn't handled properly. In this new
revisio
This diff works fine.
Not using metacharacters and passing it
as argv is the proper fix. Escaping
shell metacharacters isn't the proper way.
Warpdot() is also a little bit safer now.
It addresses some of the issues I was a bit
worried about.
This should go in !
This fixes Nima's PR and mark's issue with
filenames that start with a space.
Index: src/usr.bin/mg/dired.c
===
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.48
diff -u -p -r1.48 dired.c
--- src/usr.bin/mg/dired.c
> > However, it does seem to expose a bug in dired, that if a filename
> > has a space at the start of it, mg doesn't find it if you try and
> > open it. mg gives a message of (New File) and creates and empty
> > buffer. But in the mean time, I think this change does make this
> > diff more corre
> It fixes the issue that if a filename has a space at the start of
> it, the point will stay in the first character column and not jump
> to the first non ' ' character in the filename.
Yup, this looks good to me.
> However, it does seem to expose a bug in dired, that if a filename
> has a space
This is a slightly modified diff from Henri's latest one.
It fixes the issue that if a filename has a space at the start of
it, the point will stay in the first character column and not jump
to the first non ' ' character in the filename.
However, it does seem to expose a bug in dired, that if a
> > > The warpdot() has at least one issue. It leads to
> > > segfaults if you try to open a directory like (BCD).
> >
> > [.. diff ..]
> > > ed
> > >
> > > mg doesn't segfault.
> >
> > Your fix is wrong, and only works by chance. If you craft
> > a directory with enough spaces in its name, it'
On Sat, Aug 27, 2011 at 08:51:08PM +0300, Henri Kemppainen wrote:
> > The warpdot() has at least one issue. It leads to
> > segfaults if you try to open a directory like (BCD).
>
> [.. diff ..]
> > ed
> >
> > mg doesn't segfault.
>
> Your fix is wrong, and only works by chance. If you craft
> a
> > The warpdot() has at least one issue. It leads to
> > segfaults if you try to open a directory like (BCD).
New diff below. I wanted to make d_warpdot behave exactly
like the rest of mg functions in that it'd take the two standard
int (f, n) arguments, and dereference curwp->* to do its job.
> The warpdot() has at least one issue. It leads to
> segfaults if you try to open a directory like (BCD).
[.. diff ..]
> ed
>
> mg doesn't segfault.
Your fix is wrong, and only works by chance. If you craft
a directory with enough spaces in its name, it'll segfault
again. And you cannot fix t
> The idea of removing the error to behave like the rest
> of mg would lead to a brittle design. It's like assuming
> errors can only happen once. It makes code faster, but
> later changes could cause subtle bugs that could be hard to
> track IMHO.
Quite the opposite
The warpdot() has at least one issue. It leads to
segfaults if you try to open a directory like (BCD).
Try mkdir \(BCD\) and then reading the contents
of it.
Here's what I get:
drwxr-xr-x 2 root wheel 512 Aug 25 01:09 sh: syntax error: `('
unexpected-rw-r--r-- 1 root wheel 0
Both diffs you submitted work. However,
there are some changes that I don't quite agree on.
Assigning the value of a function directly to w_doto
without checking the return value don't seem right to me.
The idea of removing the error to behave like the rest
of mg would lead to a brittle design. I
> In the long run, the error could be removed entirely by making
> dired behave like the rest of mg -- that is, abort somewhere up
> the stream if lalloc fails. This way the rest of the functions
> will never have to worry about a NULL ltext.
Actually, this seems to be the case already. dired ca
> Logan has already tested this. Any other test's/oks?
Is there a good reason to all those if/else blocks which
call d_warpdot twice if it succeeds? I don't see one. At
the very least, I'd remove the redundant call. But we can do
better: just be sane and default to zero on error. In the long
r
Here is a modified diff, the changes revolve around
the d_warpdot function.
Logan has already tested this. Any other test's/oks?
-lum
Index: dired.c
===
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.48
diff -u -p -r
Mark Lumsden contributed code that makes
it faster. I use his suggestions as well for
other sections of the diff.
Index: dired.c
===
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.48
diff -u -p -r1.48 dired.c
--- dired.
Hi,
Jasper@ noticed warnings when compiling
on -current.
This should fix it.
Index: dired.c
===
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.48
diff -u -p -r1.48 dired.c
--- dired.c 23 Jan 2011 00:45:03 -
The 2nd diff which was posted was tested
by Nima Hoda.
The 3rd diff is mostly a cosmetic change
to make the diff less redundant.
I contacted other mg users. Hopefull,
they'll reply soon.
On Thu, Aug 18, 2011 at 08:30:02AM -0400, Loganaden Velvindron wrote:
> I used a function for warping the dot. This
> makes the diff simpler.
Since kjell@ has slacked out; any objections to committing this revision of
the diff?
> Index: dired.c
> ===
I used a function for warping the dot. This
makes the diff simpler.
Index: dired.c
===
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.48
diff -u -p -r1.48 dired.c
--- dired.c 23 Jan 2011 00:45:03 - 1.48
+++
The previous diff had issues with duplicate
colums. e.g 4 drwx-- 3 root wheel 512 Aug 9 02:36 root
using strstr() would give location of the first instance of `root'.
The following is simpler, and calculates the offset
of the 9th column, and also avoids using strtok_r()
which req
Based on discussion with mark & nima,
I think we can overwrite dired keybindings
with the ones that warp the dot to the file name.
This also fixes an issue Mark encountereted with
filenames that contain spaces.
Since this is a huge diff, I need some heavy testing ;-).
Index: dired.c
24 matches
Mail list logo