zsh-workers
 help / color / mirror / code / Atom feed
* Anybody know what's going on in xsymlinks()?  [utils.c]
@ 1999-07-14  4:47 Bart Schaefer
  1999-07-14  5:41 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 1999-07-14  4:47 UTC (permalink / raw)
  To: zsh-workers

To apply patch 7114 to 3.0.6-pre-5, I first applied it to 3.1.6-test-1 and
then ediff'd the utils.c files.  In the course of doing so, I discovered
that the xsymlinks() functions are different in the two versions.  Each is
(independently) unchanged as far back as my own archives go, and apparently
no patch was ever posted (unless it predates the archives on www.zsh.org),
so either this is something that Zefram privately added to 3.1.2 or so, or
else the 3.0.5 code is an old change that didn't get propagated into 3.1.x.
I can't find a likely-looking entry in either ChangeLog to explain it.

Does anyone know which it is?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Anybody know what's going on in xsymlinks()?  [utils.c]
  1999-07-14  4:47 Anybody know what's going on in xsymlinks()? [utils.c] Bart Schaefer
@ 1999-07-14  5:41 ` Bart Schaefer
  1999-07-14  8:21   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 1999-07-14  5:41 UTC (permalink / raw)
  To: zsh-workers

On Jul 14,  4:47am, Bart Schaefer was talking to himself again:
} Subject: Anybody know what's going on in xsymlinks()?  [utils.c]
}
} [...]
} so either this is something that Zefram privately added to 3.1.2 or so, or
} else the 3.0.5 code is an old change that didn't get propagated into 3.1.x.

On closer examination it *appears* that the 3.1.x code may be intended to
fix a memory leak, but really may have introduced a different bug.

In 3.0.x, xsymlinks() is treated as if it returns a boolean, but in fact
it's impossible AFAICT for it ever to return anything but 0.  (That means
that the apparent memory leak really wasn't one, so the fix may not have
been necessary.)

In 3.1.x, xsymlinks() returns 1 whenever it has called itself recursively,
and returns 0 otherwise.

Any clues as to what is and/or should be going on in this function would be
appreciated.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Anybody know what's going on in xsymlinks()? [utils.c]
  1999-07-14  5:41 ` Bart Schaefer
@ 1999-07-14  8:21   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 1999-07-14  8:21 UTC (permalink / raw)
  To: zsh-workers

"Bart Schaefer" wrote:
> In 3.1.x, xsymlinks() returns 1 whenever it has called itself recursively,
> and returns 0 otherwise.

It only calls itself recursively when it has just successfully found a
symbolic link, which is what the return status is really about --- it's
used to know whether to print " -> <resolved-link>" in print_if_link().
The code construction is a little odd at that point, however, since (flag
== 0) apparently has the same effect as not having CHASELINKS set, but
instead will try to read the link and then ignore the result.  I didn't see
an obvious bug but I didn't try very hard.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-07-14  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-14  4:47 Anybody know what's going on in xsymlinks()? [utils.c] Bart Schaefer
1999-07-14  5:41 ` Bart Schaefer
1999-07-14  8:21   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).