zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@frontiernet.net>
To: zefram@tao.co.uk (Andrew Main)
Cc: zsh-workers@math.gatech.edu
Subject: Re: PATCH: misc glob fixes
Date: Mon, 11 May 1998 10:49:06 -0500 (CDT)	[thread overview]
Message-ID: <199805111549.KAA90396@frontiernet.net> (raw)
In-Reply-To: <199805110936.KAA22602@taos.demon.co.uk> from Andrew Main at "May 11, 98 10:36:47 am"

Zefram wrote:
> Zoltan Hidvegi wrote:
> >First, many systems ignore trailing slashes on filenames.  As a result */
> >will match all files instead of just directories as required by common
> >sense and the POSIX standard.  The solution is to stat/lstat/access
> >`filename/.' instead of `filename/'.
> 
> But "filename/." can't be statted if the directory is not searchable
> by the zsh process, whereas POSIX would require the glob to succeed.
> It would be better to stat "filename/" and test that the result has
> type directory.

Actually I'm not sure about that.  POSIX requites that pathname
components other than the last component should be searchable.  You
can think filename/ as two components, the second component is empty.

I tested many shells (various old Korn and Bourne shells) and none of
them matches unsearchable directories with */

Also note that on Linux you need search permission on filename in
order to stat filename/, so on Linux sometimes you are not allowed to
stat filename/ while you are allowed to stat filename.  The same is
true for the good old Ultrix 4.2, and perhaps other systems.  On these
systems the patch has no effect on the shell behavior.  I think the
shell should behave the same way on all systems, and it should behave
like sh and ksh, so I think that the patch implements the correct
behavior.

Zoli


      reply	other threads:[~1998-05-11 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-09 22:17 Zoltan Hidvegi
1998-05-11  9:36 ` Andrew Main
1998-05-11 15:49   ` Zoltan Hidvegi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199805111549.KAA90396@frontiernet.net \
    --to=hzoli@frontiernet.net \
    --cc=zefram@tao.co.uk \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).