mirror of
https://github.com/cc65/cc65.git
synced 2025-01-16 13:31:16 +00:00
Merge pull request #236 from fo-fo/master
Escaping of spaces in ca65 dependency files
This commit is contained in:
commit
d99451ca50
@ -262,6 +262,21 @@ void WriteFiles (void)
|
||||
|
||||
|
||||
|
||||
static void WriteEscaped (FILE* F, const char* Name)
|
||||
/* Write a file name to a dependency file escaping spaces */
|
||||
{
|
||||
while (*Name) {
|
||||
if (*Name == ' ') {
|
||||
/* Escape spaces */
|
||||
fputc ('\\', F);
|
||||
}
|
||||
fputc (*Name, F);
|
||||
++Name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void WriteDep (FILE* F, FileType Types)
|
||||
/* Helper function. Writes all file names that match Types to the output */
|
||||
{
|
||||
@ -285,9 +300,9 @@ static void WriteDep (FILE* F, FileType Types)
|
||||
fputc (' ', F);
|
||||
}
|
||||
|
||||
/* Print the dependency */
|
||||
/* Print the dependency escaping spaces */
|
||||
Filename = GetStrBuf (E->Name);
|
||||
fprintf (F, "%*s", SB_GetLen (Filename), SB_GetConstBuf (Filename));
|
||||
WriteEscaped (F, SB_GetConstBuf (Filename));
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,7 +320,8 @@ static void CreateDepFile (const char* Name, FileType Types)
|
||||
}
|
||||
|
||||
/* Print the output file followed by a tab char */
|
||||
fprintf (F, "%s:\t", OutFile);
|
||||
WriteEscaped (F, OutFile);
|
||||
fputs (":\t", F);
|
||||
|
||||
/* Write out the dependencies for the output file */
|
||||
WriteDep (F, Types);
|
||||
|
Loading…
x
Reference in New Issue
Block a user