+2002-07-19 Alan Modra <amodra@bigpond.net.au>
+
+ * prefix.c (update_path): Don't zap single `.' path components
+ unless followed by another `.' and fix typo last patch.
+
2002-07-18 Neil Booth <neil@daikokuya.co.uk>
* cppexp.c (cpp_num_mul): Remove unused parameter.
p = strchr (p, '.');
if (p == NULL)
break;
- /* Get rid of a leading `./' and replace `/./' with `/'. */
+ /* Get rid of a leading `./' and replace `/./' with `/', when
+ such components are followed with another `.'. */
if (IS_DIR_SEPARATOR (p[1])
&& (p == result || IS_DIR_SEPARATOR (p[-1])))
{
/* Be careful about .//foo */
while (IS_DIR_SEPARATOR (*src))
++src;
- dest = p;
- while ((*dest++ = *src++) != 0)
- ;
+ if (*src == '.')
+ {
+ dest = p;
+ while ((*dest++ = *src++) != 0)
+ ;
+ }
+ else
+ ++p;
}
/* Look for `/../' */
else if (p[1] == '.'
dest = p - 1;
while (dest != result && IS_DIR_SEPARATOR (*dest))
--dest;
- while (dest != result && IS_DIR_SEPARATOR (dest[-1]))
+ while (dest != result && !IS_DIR_SEPARATOR (dest[-1]))
--dest;
/* Don't strip leading `/'. */
while (IS_DIR_SEPARATOR (*dest))