/*
* Don't cache trivial valid directory entries.
*/
/*
* Don't cache trivial valid directory entries.
*/
- if((strcmp(full_orig_name, ".") == 0) || (strcmp(full_orig_name, "..") == 0))
+ if((*full_orig_name == '\0') || (strcmp(full_orig_name, ".") == 0) ||
+ (strcmp(full_orig_name, "..") == 0))
/*
* Don't lookup trivial valid directory entries.
*/
/*
* Don't lookup trivial valid directory entries.
*/
- if((strcmp(name, ".") == 0) || (strcmp(name, "..") == 0)) {
+ if((*name == '\0') || (strcmp(name, ".") == 0) || (strcmp(name, "..") == 0)) {
global_stat_cache_misses++;
return False;
}
global_stat_cache_misses++;
return False;
}
trim_string(name,"/","/");
trim_string(name,"/","/");
+ /*
+ * If we trimmed down to a single '\0' character
+ * then we should use the "." directory to avoid
+ * searching the cache.
+ */
+
+ if(!*name) {
+ name[0] = '.';
+ name[1] = '\0';
+ }
+
/*
* Ensure saved_last_component is valid even if file exists.
*/
/*
* Ensure saved_last_component is valid even if file exists.
*/