From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 10 Nov 1995 03:58:16 -0500 From: presotto@plan9.att.com presotto@plan9.att.com Subject: ftpfs change to compensate for some servers Topicbox-Message-UUID: 33a8a788-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19951110085816.7pUiVSnJ54wQdy63LxPV3in3h8Jg8hHRyWo6s-94d-Y@z> 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().