version 1.51, 1998/03/10 17:03:29
|
version 1.52, 1998/03/10 22:24:16
|
Line 629 char *docName;
|
Line 629 char *docName;
|
if (IsW3Path (tempOrgName)) { |
if (IsW3Path (tempOrgName)) { |
/* the name is complete, go to the Sixth Step */ |
/* the name is complete, go to the Sixth Step */ |
strcpy (newName, tempOrgName); |
strcpy (newName, tempOrgName); |
|
SimplifyUrl (&newName); |
/* verify if the URL has the form "protocol://server:port" */ |
/* verify if the URL has the form "protocol://server:port" */ |
ptr = AmayaParseUrl (newName, "", AMAYA_PARSE_ACCESS | AMAYA_PARSE_HOST | AMAYA_PARSE_PUNCTUATION); |
ptr = AmayaParseUrl (newName, "", AMAYA_PARSE_ACCESS | AMAYA_PARSE_HOST | AMAYA_PARSE_PUNCTUATION); |
if (ptr && !strcmp (ptr, newName)) /* it has this form, we complete it by adding a DIR_STR */ |
if (ptr && !strcmp (ptr, newName)) /* it has this form, we complete it by adding a DIR_STR */ |
Line 854 HTURI *parts;
|
Line 855 HTURI *parts;
|
|
|
memset (parts, '\0', sizeof (HTURI)); |
memset (parts, '\0', sizeof (HTURI)); |
/* Look for fragment identifier */ |
/* Look for fragment identifier */ |
if ((p = strrchr(name, '#')) != NULL) |
if ((p = strchr(name, '#')) != NULL) |
{ |
{ |
*p++ = '\0'; |
*p++ = '\0'; |
parts->fragment = p; |
parts->fragment = p; |
Line 1029 int wanted;
|
Line 1030 int wanted;
|
p[1]=0; |
p[1]=0; |
/* Add given one */ |
/* Add given one */ |
strcat (result, given.relative); |
strcat (result, given.relative); |
/*SimplifyUrl (&result);*/ |
|
} |
} |
} |
} |
else if (given.relative) |
else if (given.relative) |
Line 1279 char **url;
|
Line 1279 char **url;
|
{ |
{ |
orig = p + 1; |
orig = p + 1; |
dest = (*(p+2)!=used_sep) ? p+2 : p+3; |
dest = (*(p+2)!=used_sep) ? p+2 : p+3; |
while ((*orig++ = *dest++)); /* Remove a slash and a dot */ |
while ((*orig++ = *dest++)); /* Remove a used_sep and a dot*/ |
end = orig - 1; |
end = orig - 1; |
} |
} |
else if (*(p+1)=='.' && *(p+2)=='.' && (*(p+3)==used_sep || !*(p+3))) |
else if (*(p+1)=='.' && *(p+2)=='.' && (*(p+3)==used_sep || !*(p+3))) |
{ |
{ |
newptr = p; |
newptr = p; |
while (newptr>path && *--newptr!=used_sep); /* prev slash */ |
while (newptr>path && *--newptr!=used_sep); /* prev used_sep */ |
if (!strncmp(newptr, "/../", 4)) |
if (*newptr == used_sep) |
{ |
orig = newptr + 1; |
orig = newptr + 1; |
|
dest = (*(p+3)!=used_sep) ? p+3 : p+4; |
|
while ((*orig++ = *dest++)); /* Remove /xxx/.. */ |
|
end = orig-1; |
|
/* Start again with prev slash */ |
|
p = newptr; |
|
} |
|
else |
else |
p++; |
orig = newptr; |
|
|
|
dest = (*(p+3) != used_sep) ? p+3 : p+4; |
|
while ((*orig++ = *dest++)); /* Remove /xxx/.. */ |
|
end = orig-1; |
|
/* Start again with prev slash */ |
|
p = newptr; |
} |
} |
else if (*(p+1) == used_sep) |
else if (*(p+1) == used_sep) |
{ |
{ |
Line 1319 char **url;
|
Line 1318 char **url;
|
/* |
/* |
** Check for host/../.. kind of things |
** Check for host/../.. kind of things |
*/ |
*/ |
if (*path=='/' && *(path+1)=='.' && *(path+2)=='.' && (!*(path+3) || *(path+3)=='/')) |
if (*path==used_sep && *(path+1)=='.' && *(path+2)=='.' && (!*(path+3) || *(path+3)==used_sep)) |
*(path+1) = EOS; |
*(path+1) = EOS; |
|
|
return; |
return; |
Line 1466 char *relatedName;
|
Line 1465 char *relatedName;
|
else |
else |
{ |
{ |
levels= 0; |
levels= 0; |
for (; *q && (*q != '#'); q++) |
for (; *q && *q != '#' && *q!=';' && *q!='?'; q++) |
if (*q == DIR_SEP) |
if (*q == DIR_SEP) |
levels++; |
levels++; |
|
|
result[0] = 0; |
result[0] = EOS; |
for (;levels; levels--) |
for (;levels; levels--) |
strcat (result, "../"); |
strcat (result, "../"); |
strcat (result, last_slash+1); |
strcat (result, last_slash+1); |
} |
} |
|
|
|
if (!*result) |
|
strcat (result, "./"); |
|
|
/* exactly the right length */ |
/* exactly the right length */ |
len = strlen (result); |
len = strlen (result); |
if ((return_value = (char *) TtaGetMemory (len + 1)) != NULL) |
if ((return_value = (char *) TtaGetMemory (len + 1)) != NULL) |
strcpy (return_value, result); |
strcpy (return_value, result); |
|
|
} |
} |
# ifdef _WINDOWS |
# ifdef _WINDOWS |
len = strlen (return_value); |
len = strlen (return_value); |