Change make_token and dup_basename to also support Windows paths.

Colin Finck mail at colinfinck.de
Sat Dec 22 14:11:48 CST 2007


Otherwise these functions do not work properly under Windows hosts.
---
 tools/widl/utils.c |    3 +++
 tools/widl/widl.c  |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/widl/utils.c b/tools/widl/utils.c
index e77361c..ed950f6 100644
--- a/tools/widl/utils.c
+++ b/tools/widl/utils.c
@@ -136,6 +136,9 @@ char *dup_basename(const char *name, const char *ext)
   name = "widl.tab";

  slash = strrchr(name, '/');
+ if (!slash)
+  slash = strrchr(name, '\\');
+
  if (slash)
   name = slash + 1;

diff --git a/tools/widl/widl.c b/tools/widl/widl.c
index 7945694..07f024c 100644
--- a/tools/widl/widl.c
+++ b/tools/widl/widl.c
@@ -166,6 +166,9 @@ static char *make_token(const char *name)
   int i;

   slash = strrchr(name, '/');
+  if(!slash)
+    slash = strrchr(name, '\\');
+
   if (slash) name = slash + 1;

   token = xstrdup(name);
-- 
1.4.4.2






More information about the wine-patches mailing list