Change make_token and dup_basename to also support Windows paths. Remove the previous hack for this. Fixes the build for Windows users.

I'll update the widl_ros.diff file later :-P

svn path=/trunk/; revision=31815
This commit is contained in:
Colin Finck 2008-01-15 21:34:24 +00:00
parent b3349ee656
commit ec72c52773
2 changed files with 7 additions and 6 deletions

View file

@ -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;

View file

@ -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);
@ -549,12 +552,7 @@ int main(int argc,char *argv[])
}
if(do_header) {
if (strrchr(header_name, '\\'))
header_token = make_token(strrchr(header_name, '\\') + 1);
else if (strrchr(header_name, '/'))
header_token = make_token(strrchr(header_name, '/') + 1);
else
header_token = make_token(header_name);
header_token = make_token(header_name);
if(!(header = fopen(header_name, "w"))) {
fprintf(stderr, "Could not open %s for output\n", header_name);