Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: whence following symlinks


>>>>> "Zefram" == Zefram  <zefram@xxxxxxxxxxxxxxxxx> writes:

    Zefram> Juergen A. Erhard wrote:
    >> Unfortunately, 'whence -ms' doesn't work as expected, because '-m'
    >> jumps to a different code section, and that code doesn't care for
    >> '-s'.

    Zefram> You could duplicate the new code, or use the hashtable printnode() method.

Okay, I'll check this printnode() out...

    >> ! 		/* temporarily set CHASELINKS */
    >> ! 		chase = isset(CHASELINKS);
    >> ! 		dosetopt(CHASELINKS, 1, 0);
    Zefram> ...
    >> ! 		/* revert setting of CHASELINKS */
    >> ! 		dosetopt(CHASELINKS, chase, 0);

    Zefram> Do

    Zefram> 	chase = opts[CHASELINKS];
    Zefram> 	opts[CHASELINKS] = 1;
    Zefram> 	...
    Zefram> 	opts[CHASELINKS] = chase;

Well, there's a reason to my madness ;-)...

I simply don't like directly editing some data structures that might
or might not transmogrify into something completely different...

On the other hand, you're right in your (implied) statement that
dosetopt might carry too much overhead...

So, if TPTB gives me the ok to use your suggestion (that is,
they/he/she/it guarantees opts to stay a simple int[]), I will.

    >> ! 		/* throw away try_link... hope this is the right fn */
    >> ! 		zsfree(try_link);

    Zefram> It is the right function.

Thanks. I'd really love to see a couple more comments on this
beast. Especially on fns like 'xsymlink'... I had to RTFS to find out
I had to free(3) the result... and had to guess (more or less) on
zsfree (the doc on the mem-mgt could be better... or maybe I could be
smarter ;-)

    Zefram> -zefram

Bye, J

- -- 
Juergen A. Erhard (that ue is actually \"u (TeX) or &uuml; (HTML/SGML))
eMail: jae@xxxxxxxxxxxx                             |
snailMail: Belfortstr. 6; 76133 Karlsruhe; GERMANY  |  pros do it for money,
phone: +49 721 27326                                |  amateurs out of love.
WWW: http://members.tripod.com/~Juergen_Erhard/     |

Version: 2.6.3ia
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface


Messages sorted by: Reverse Date, Date, Thread, Author