1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00

Escape spaces in target path.

cc65 escapes spaces in paths it writes to dependency files (see WriteEscaped() in cc65/input.c). Given that the output of OptPrintTargetPath() is supposed to be used in Makefiles in pretty much the same way it is appropriate to escape spaces here too.
This commit is contained in:
Oliver Schmidt 2018-06-07 17:10:33 +02:00
parent aea34c5410
commit d861be8ad5

View File

@ -1165,19 +1165,28 @@ static void OptPrintTargetPath (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print the target file path */
{
SearchPaths* TargetPath = NewSearchPath ();
AddSubSearchPathFromEnv (TargetPath, "CC65_HOME", "target");
#if defined(CL65_TGT) && !defined(_WIN32)
AddSearchPath (TargetPath, STRINGIZE (CL65_TGT));
#endif
AddSubSearchPathFromWinBin (TargetPath, "target");
char* TargetPath;
printf ("%s\n", GetSearchPath (TargetPath, 0));
SearchPaths* TargetPaths = NewSearchPath ();
AddSubSearchPathFromEnv (TargetPaths, "CC65_HOME", "target");
#if defined(CL65_TGT) && !defined(_WIN32)
AddSearchPath (TargetPaths, STRINGIZE (CL65_TGT));
#endif
AddSubSearchPathFromWinBin (TargetPaths, "target");
TargetPath = GetSearchPath (TargetPaths, 0);
while (*TargetPath) {
if (*TargetPath == ' ') {
/* Escape spaces */
putchar ('\\');
}
putchar (*TargetPath++);
}
putchar ('\n');
exit (EXIT_SUCCESS);
}
static void OptRegisterSpace (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --register-space option */
{