httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bishop <bis...@platypus.bc.ca>
Subject Re: server config directory patch
Date Sat, 06 Jan 2001 23:02:11 GMT
Greg;

My fault.  

I had a larger check string there, decided to just check for /^\./ instead,
and didn't think long enough to make it cuter as a function.

 - bishop

Greg Marr wrote:
> 
> At 07:32 AM 01/05/2001, Geoffrey Young wrote:
> >hi again...
> >
> >after a little prodding to come up with a more simple solution (sans
> >regex)
> >by some helpful folks, here's an alternative:
> >
> >--- http_config.c.old   Thu Jan  4 11:38:14 2001
> >+++ http_config.c       Thu Jan  4 11:49:43 2001
> >@@ -1252,9 +1252,8 @@
> >         }
> >         candidates = ap_make_array(p, 1, sizeof(fnames));
> >         while ((dir_entry = readdir(dirp)) != NULL) {
> >+           /* strip out '.' and '..' as well as hidden '.files' */
> >+           if (strncmp(dir_entry->d_name, ".", 1)) {
> 
> Isn't a strncmp a bit overkill to check the first character of the
> filename?
> if (dir_entry->d_name[0] == ".") {
> 
> --
> Greg Marr
> gregm@alum.wpi.edu
> "We thought you were dead."
> "I was, but I'm better now." - Sheridan, "The Summoning"

-- 
At the airport, I'll be wearing black clothes, and a
bright yellow find-my-body gore-tex expedition jacket.
Also, I'll be the guy hand-carrying a case of beer.
                                   - EDeO 200012300131

Mime
View raw message