Fix #1807329 - When Makefile dependencies are being generated using the -M family of options on Windows, the file paths have been corrected to use single backslashes rather than double backslashes as path separators.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11847 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b40a8e38ab
commit
207ba5ce39
6 changed files with 30 additions and 11 deletions
|
|
@ -1,6 +1,11 @@
|
|||
Version 1.3.41 (in progress)
|
||||
============================
|
||||
|
||||
2010-02-08: wsfulton
|
||||
Fix #1807329 - When Makefile dependencies are being generated using the -M family of options
|
||||
on Windows, the file paths have been corrected to use single backslashes rather than double
|
||||
backslashes as path separators.
|
||||
|
||||
2010-02-06: wsfulton
|
||||
Fix #2918902 - language specific files not being generated in correct directory on
|
||||
Windows when using forward slashes for -o, for example:
|
||||
|
|
|
|||
|
|
@ -1022,7 +1022,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
if (lang_config) {
|
||||
Printf(fs, "\n%%include <%s>\n", lang_config);
|
||||
}
|
||||
Printf(fs, "%%include(maininput=\"%s\") \"%s\"\n", Swig_filename_escape(input_file), Swig_last_file());
|
||||
Printf(fs, "%%include(maininput=\"%s\") \"%s\"\n", Swig_filename_escape(input_file), Swig_filename_escape(Swig_last_file()));
|
||||
for (i = 0; i < Len(libfiles); i++) {
|
||||
Printf(fs, "\n%%include \"%s\"\n", Getitem(libfiles, i));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ unterm:
|
|||
/* -----------------------------------------------------------------------------
|
||||
* DOH *get_filename(DOH *str)
|
||||
*
|
||||
* Read a filename from str. A filename can be enclose in quotes, angle brackets,
|
||||
* Read a filename from str. A filename can be enclosed in quotes, angle brackets,
|
||||
* or bare.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
|
@ -652,6 +652,7 @@ static String *get_filename(String *str, int *sysfile) {
|
|||
if (isspace(c))
|
||||
Ungetc(c, str);
|
||||
}
|
||||
Swig_filename_unescape(fn);
|
||||
Swig_filename_correct(fn);
|
||||
Seek(fn, 0, SEEK_SET);
|
||||
return fn;
|
||||
|
|
@ -1593,9 +1594,9 @@ String *Preprocessor_parse(String *s) {
|
|||
s1 = cpp_include(fn, sysfile);
|
||||
if (s1) {
|
||||
if (include_all)
|
||||
Printf(ns, "%%includefile \"%s\" [\n", Swig_last_file());
|
||||
Printf(ns, "%%includefile \"%s\" [\n", Swig_filename_escape(Swig_last_file()));
|
||||
else if (import_all) {
|
||||
Printf(ns, "%%importfile \"%s\" [\n", Swig_last_file());
|
||||
Printf(ns, "%%importfile \"%s\" [\n", Swig_filename_escape(Swig_last_file()));
|
||||
push_imported();
|
||||
}
|
||||
|
||||
|
|
@ -1732,7 +1733,7 @@ String *Preprocessor_parse(String *s) {
|
|||
char *dirname;
|
||||
add_chunk(ns, chunk, allow);
|
||||
copy_location(s, chunk);
|
||||
Printf(ns, "%sfile%s \"%s\" [\n", decl, opt, Swig_last_file());
|
||||
Printf(ns, "%sfile%s \"%s\" [\n", decl, opt, Swig_filename_escape(Swig_last_file()));
|
||||
if (Equal(decl, kpp_dimport)) {
|
||||
push_imported();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,9 +184,8 @@ static FILE *Swig_open_file(const_String_or_char_ptr name, int sysfile, int use_
|
|||
}
|
||||
if (f) {
|
||||
Delete(lastpath);
|
||||
lastpath = Swig_filename_escape(filename);
|
||||
lastpath = filename;
|
||||
}
|
||||
Delete(filename);
|
||||
return f;
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +243,7 @@ static String *Swig_include_any(const_String_or_char_ptr name, int sysfile) {
|
|||
str = Swig_read_file(f);
|
||||
fclose(f);
|
||||
Seek(str, 0, SEEK_SET);
|
||||
file = Copy(lastpath);
|
||||
file = Copy(Swig_last_file());
|
||||
Setfile(str, file);
|
||||
Delete(file);
|
||||
Setline(str, 1);
|
||||
|
|
|
|||
|
|
@ -159,12 +159,25 @@ void Swig_filename_correct(String *filename) {
|
|||
String *Swig_filename_escape(String *filename) {
|
||||
String *adjusted_filename = Copy(filename);
|
||||
#if defined(_WIN32) /* Note not on Cygwin else filename is displayed with double '/' */
|
||||
Replaceall(adjusted_filename, "\\\\", "\\"); /* remove double '\' in case any already present */
|
||||
Replaceall(adjusted_filename, "\\", "\\\\");
|
||||
Replaceall(adjusted_filename, "\\\\", "\\"); /* remove double '\' in case any already present */
|
||||
Replaceall(adjusted_filename, "\\", "\\\\");
|
||||
#endif
|
||||
return adjusted_filename;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Swig_filename_unescape()
|
||||
*
|
||||
* Remove double backslash escaping in filename - for Windows
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void Swig_filename_unescape(String *filename) {
|
||||
(void)filename;
|
||||
#if defined(_WIN32)
|
||||
Replaceall(filename, "\\\\", "\\");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Swig_string_escape()
|
||||
*
|
||||
|
|
|
|||
|
|
@ -294,8 +294,9 @@ extern int ParmList_is_compactdefargs(ParmList *p);
|
|||
extern void Swig_banner(File *f);
|
||||
extern void Swig_banner_target_lang(File *f, const_String_or_char_ptr commentchar);
|
||||
extern String *Swig_strip_c_comments(const String *s);
|
||||
extern String *Swig_filename_escape(String *filename);
|
||||
extern void Swig_filename_correct(String *filename);
|
||||
extern String *Swig_filename_escape(String *filename);
|
||||
extern void Swig_filename_unescape(String *filename);
|
||||
extern String *Swig_string_escape(String *s);
|
||||
extern String *Swig_string_mangle(const String *s);
|
||||
extern void Swig_scopename_split(const String *s, String **prefix, String **last);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue