mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 13:11:00 +00:00
[qfcc] Handle quote includes better
The path for the current file wasn't being set correctly at startup and "error: success" never makes much sense.
This commit is contained in:
parent
ffb2514e75
commit
47c60f2bbf
1 changed files with 6 additions and 2 deletions
|
@ -51,6 +51,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include "QF/dstring.h"
|
#include "QF/dstring.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
|
@ -567,6 +568,9 @@ cpp_find_file (const char *name, int quote, bool *is_system)
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!errno) {
|
||||||
|
errno = ENOENT;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -574,12 +578,12 @@ void
|
||||||
cpp_set_quote_file (const char *path)
|
cpp_set_quote_file (const char *path)
|
||||||
{
|
{
|
||||||
if (!path) {
|
if (!path) {
|
||||||
cpp_quote_start = pr.comp_dir;
|
cpp_quote_start = "";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char *e = strrchr (path, '/');
|
const char *e = strrchr (path, '/');
|
||||||
if (!e) {
|
if (!e) {
|
||||||
cpp_quote_start = pr.comp_dir;
|
cpp_quote_start = "";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cpp_quote_start = save_substring (path, e - path);
|
cpp_quote_start = save_substring (path, e - path);
|
||||||
|
|
Loading…
Reference in a new issue