mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
Escape spaces in depfile with backslashes.
This matches how Linux escapes spaces in paths.
The same syntax is also used by other build tools that output depfiles,
e.g. edd36eba5e/src/cargo/core/compiler/output_depinfo.rs (L19)
Signed-off-by: Colin Finck <mail@colinfinck.de>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
f9968fa069
commit
18aa49a9f6
4 changed files with 28 additions and 3 deletions
16
util.c
16
util.c
|
@ -23,6 +23,22 @@
|
|||
#include "util.h"
|
||||
#include "version_gen.h"
|
||||
|
||||
void fprint_path_escaped(FILE *fp, const char *path)
|
||||
{
|
||||
const char *p = path;
|
||||
|
||||
while (*p) {
|
||||
if (*p == ' ') {
|
||||
fputc('\\', fp);
|
||||
fputc(' ', fp);
|
||||
} else {
|
||||
fputc(*p, fp);
|
||||
}
|
||||
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
char *xstrdup(const char *s)
|
||||
{
|
||||
int len = strlen(s) + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue