version 1.127, 2001/11/20 15:17:47
|
version 1.128, 2001/11/21 08:13:12
|
Line 1816 void SimplifyUrl (char **url)
|
Line 1816 void SimplifyUrl (char **url)
|
/* Doesn't need to do any more */ |
/* Doesn't need to do any more */ |
return; |
return; |
} |
} |
|
/* In case of a user typed url without protocol specification |
|
and filepath like url (the ~ or / url beginning), |
|
we add the http:// (more conveniant when you often type urls) |
|
so that you can now enter w3.org directly */ |
else if (**url != DIR_SEP |
else if (**url != DIR_SEP |
&& **url != '~' |
&& **url != '~' |
#ifdef _WINDOWS |
#ifdef _WINDOWS |
&& (*url)[1] != ':' |
&& (*url)[1] != ':' |
#endif /* _WINDOWS */ |
#endif /* _WINDOWS */ |
&& !IsW3Path(*url) |
&& !IsW3Path(*url) |
/* && TtaFileExist (*url) == 0) */ |
|
&& (strlen (*url) + 8) < MAX_LENGTH) |
&& (strlen (*url) + 8) < MAX_LENGTH) |
{ |
{ |
/* In case of a user typed url without protocol specification |
if (TtaFileExist (*url) == 0) |
and filepath like url (the ~ or / url beginning), |
{ |
we add the http:// (more conveniant when you often type urls) |
newptr = TtaGetMemory (strlen (*url) + 8); |
so that you can now enter w3.org directly */ |
*newptr = EOS; |
newptr = TtaGetMemory (strlen (path) + 8); |
strcat (newptr, "http://"); |
*newptr = EOS; |
strcat (newptr, *url); |
strcat (newptr, "http://"); |
**url = EOS; |
strcat (newptr, *url); |
strcpy (*url, newptr); |
**url = EOS; |
TtaFreeMemory (newptr); |
strcpy (*url, newptr); |
return; |
TtaFreeMemory (newptr); |
} |
return; |
/* /!\ WARNING : if you append an else if below |
|
be sure move the fileexist test in the else if |
|
upper, because the only reason of the separation |
|
is Optimization. If you don't do so, the process |
|
will not go into your code if the user types a filename |
|
*/ |
} |
} |
|
|
if ((p = path)) |
if ((p = path)) |