From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net Date: Tue, 29 Apr 2008 08:32:06 +0000 From: eekee57 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <006cc24d595f7b43910034f84f6c8287@terzarima.net> Subject: Re: [9fans] ftpfs ahould not expose "." and ".." directories Topicbox-Message-UUID: 9b2a6e04-ead3-11e9-9d60-3106f5b1d025 Honestly I went with strncmp() over strcmp() on little more than a hunch. I actually prefer strcmp() as looking cleaner, with one less arg and no need to remember the existence fo the null at the end. Maybe I'll change it. As to the style of logic, strncmp() and strcmp() both return zero for an exact match, a positive number if arg1 is lexicographically greater than arg2, and a negative number if arg1 is less. This is not strictly a boolean output, so my choice of !strncmp(...) is probably bad style anywhere. I remember old assembly language too well. How about this for style? if(strcmp(".", field[7]) == 0 || strcmp("..", field[7]) == 0) return nil;