int allowdotdot = 0;
if (reldir) {
- depth++;
+ int new_component = 1;
while (*reldir) {
- if (*reldir++ == '/') {
+ if (*reldir++ == '/')
+ new_component = 1;
+ else if (new_component) {
+ new_component = 0;
depth++;
}
}
* The string " (in MODNAME)" may also be appended. The returned pointer
* remains valid until the next time full_fname() is called.
**/
-char *full_fname(char *fn)
+char *full_fname(const char *fn)
{
static char *result = NULL;
char *m1, *m2, *m3;
struct timeval tval, t1, t2;
gettimeofday(&t1, NULL);
- gettimeofday(&t2, NULL);
while (tdiff < t) {
tval.tv_sec = (t-tdiff)/1000;