[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] added sh-utils/dirname backslash support

From: Bob Proulx
Subject: Re: [Patch] added sh-utils/dirname backslash support
Date: Wed, 20 Feb 2002 21:23:51 -0700

> the current dirname tool does not support backslash support. This
> patch fixes this.

-  slash = strrchr (path, '/');
+  slash = strrchr (path, delim);
+  if (slash == NULL)
+    delim = '\\';
+    slash = strrchr (path, delim);

I do not believe this is valid.  It appears to say, if no / found in
filename then fallback to using \ as the delimiter.  But that is not
valid for most operating systems.

  dirname /path/foo\bar/foobar
  dirname /path/foo\bar
  /path/foo   <-  Incorrect


reply via email to

[Prev in Thread] Current Thread [Next in Thread]