Branch: Tag:

2001-08-13

2001-08-13 18:18:48 by Per Hedbor <ph@opera.com>

Use system.normalize_path if available

Rev: server/modules/filesystems/filesystem.pike:1.103

7:   inherit "module";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.102 2001/08/01 19:35:05 per Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.103 2001/08/13 18:18:48 per Exp $";   constant thread_safe=1;      #include <module.h>
208:    FILESYSTEM_WERR("stat_file for \""+f+"\"" +    (id->misc->internal_get ? " (internal)" : ""));    +  f = path+f; +     if (FILTER_INTERNAL_FILE (f, id))    return 0;       if(stat_cache && !id->pragma["no-cache"] && -  (fs=cache_lookup("stat_cache",path+f))) +  (fs=cache_lookup("stat_cache",f)))    return fs[0];    object privs;    if (access_as_user && ((int)id->misc->uid) && ((int)id->misc->gid))
220:    privs=Privs("Statting file", (int)id->misc->uid, (int)id->misc->gid );       /* No security currently in this function */ -  fs = file_stat(decode_path(path + f)); +  fs = file_stat(decode_path(f));    privs = 0;    if(!stat_cache) return fs; -  cache_set("stat_cache", path+f, ({fs})); +  cache_set("stat_cache", f, ({fs}));    return fs;   }   
388:    while( strlen(p) && p[-1] == '/' )    p = p[..strlen(p)-2];   #endif + #if constant( system.normalize_path ) +  p = system.normalize_path( p ); + #endif    return p;   }