9fans archive / 1995 / 11 / 68 / prev next
From: forsyth@pla... forsyth@pla...
Subject: ftpfs change to compensate for some servers
Date: Thu, 9 Nov 1995 15:02:02 -0500
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');