httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Marr <gr...@alum.wpi.edu>
Subject RE: server config directory patch
Date Fri, 05 Jan 2001 14:21:03 GMT
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"


Mime
View raw message