From: presotto@plan9.att.com presotto@plan9.att.com
Subject: ftpfs change to compensate for some servers
Date: Fri, 10 Nov 1995 03:58:16 -0500 [thread overview]
Message-ID: <19951110085816.7pUiVSnJ54wQdy63LxPV3in3h8Jg8hHRyWo6s-94d-Y@z> (raw)
some FTP servers include . and .. in the list, which messes up
common commands applied to a mounted ftpfs directory.
the following change prevents them from being seen:
vortex% diff $home/cd/cmd/ftpfs /sys/src/cmd/ftpfs/proto.c
38a39
> static int isdotdot(char*);
670a672,673
> if(isdotdot(field[7]))
> return 0;
681a685,686
> if(isdotdot(field[8]))
> return 0;
692a698,699
> if(isdotdot(field[9]))
> return 0;
703a711,712
> if(isdotdot(field[0]))
> return 0;
721a731,736
> }
>
> static int
> isdotdot(char *n)
> {
> return n[0]=='.' && (n[1]=='\0' || n[1]=='.' && n[2]=='\0');
I think this is easier and more correct since it covers all systems, not
just Unix-like:
at the end of the switch statement of crackdir(), before
line 714, add
if(strcmp(longname, ".") == 0 || strcmp(longname, "..") == 0)
return 0;
or, if the strcmp's bug you, use forsyth's isdotdot().
next reply other threads:[~1995-11-10 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-11-10 8:58 presotto [this message]
-- strict thread matches above, loose matches on Subject: below --
1995-11-10 16:16 forsyth
1995-11-09 20:02 forsyth
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=19951110085816.7pUiVSnJ54wQdy63LxPV3in3h8Jg8hHRyWo6s-94d-Y@z \
--to=presotto@plan9.att.com \
/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.
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).