On 29/11/2007, at 9:21 PM, Richard Toohey wrote:

On 21/11/2007, at 10:48 PM, Otto Moerbeek wrote:
I think dump should 'vis' the filenames it prints.

        -Otto



[cut]
(Just done some more testing before posting and realized that I have only looked at verbose mode ls, so still got more work to do - but it only seems to be verbose mode that causes the xterm hang, and I'd like feedback anyway.)

[cut]

So I look at interactive.c some more to see why non-verbose mode works, and I would very much appreciate some advice on this ...

/usr/src/sbin/restore/interactive.c

c. line 509 (4.2 RELEASE) is print_list() - invoked when an 'ls' command is used. c. line 526 it calls mkentry() - c. line 592 mkentry() definition ... and it looks at filenames c. line 600:

600         for (cp = fp->fname; *cp; cp++)
601                 if (!vflag && (*cp < ' ' || *cp >= 0177))
602                         *cp = '?';
603         fp->len = cp - fp->fname;

Why does it only replace the characters (less than spc or >= del) in NON-verbose mode? What would the reasoning behind that be?

A simpler (but less correct?) non-vis fix would be to drop the vflag test. I tried that and it worked.

I could drop the test and change mkentry to store the vis()d filenames (but potentially 4x space required for each name - guess could vis and copy back again - more thinking required.)

Thanks.

The patch:

# diff -uw /usr/src/sbin/restore/interactive.c interactive.c


[cut]

And the patch is not a patch because of spaces replacing tabs (still working on how to fix that in my mail client) - thanks for the feedback.

Reply via email to