More on tilde expansion
Leonard den Ottolander
leonard at den.ottolander.nl
Wed Sep 15 12:41:33 UTC 2004
Hi,
I wrote:
> The problem appears to originate from file_mask_dialog() in
> src/filegui.c (gdb shows dest_dir = g_strdup ("./") gets called for
> single file copies to locations without a slash), but the logic of that
> function is still rather incomprehensible to me...
>
> Fe, look at
> orig_mask = ctx->dest_mask;
> ...
> ctx->dest_mask = g_strdup (ctx->dest_mask);
> *orig_mask = 0;
The use of orig_mask in this example is needless and wrong, as instead
of "nulling" the string dest_dir (which orig_mask is pointing to) should
be g_freed.
Anyway, I think I finally got it. Since the ctx->dest_mask should also
be tilde expanded (preferably before it is construed from dest_dir) the
easiest solution is to move the tilde_expand to file_mask_dialog() in
src/filegui.c so this function returns tilde expanded values. See
attached patch (against CVS-20040915) for details (and please verify its
validity).
Leonard.
--
mount -t life -o ro /dev/dna /genetic/research
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tilde-expand.patch
Type: text/x-patch
Size: 1439 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20040915/a10d0161/attachment.bin>
More information about the mc-devel
mailing list