mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 19:29:37 +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:
parent
aea34c5410
commit
d861be8ad5
@ -1165,19 +1165,28 @@ static void OptPrintTargetPath (const char* Opt attribute ((unused)),
|
|||||||
const char* Arg attribute ((unused)))
|
const char* Arg attribute ((unused)))
|
||||||
/* Print the target file path */
|
/* Print the target file path */
|
||||||
{
|
{
|
||||||
SearchPaths* TargetPath = NewSearchPath ();
|
char* TargetPath;
|
||||||
AddSubSearchPathFromEnv (TargetPath, "CC65_HOME", "target");
|
|
||||||
#if defined(CL65_TGT) && !defined(_WIN32)
|
|
||||||
AddSearchPath (TargetPath, STRINGIZE (CL65_TGT));
|
|
||||||
#endif
|
|
||||||
AddSubSearchPathFromWinBin (TargetPath, "target");
|
|
||||||
|
|
||||||
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);
|
exit (EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void OptRegisterSpace (const char* Opt attribute ((unused)), const char* Arg)
|
static void OptRegisterSpace (const char* Opt attribute ((unused)), const char* Arg)
|
||||||
/* Handle the --register-space option */
|
/* Handle the --register-space option */
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user