summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--preproc.c2
-rw-r--r--test/_file_.asm5
2 files changed, 6 insertions, 1 deletions
diff --git a/preproc.c b/preproc.c
index 7ba1b6fe..feb1164c 100644
--- a/preproc.c
+++ b/preproc.c
@@ -3493,7 +3493,7 @@ again:
if (!m->expansion) {
if (!strcmp("__FILE__", m->name)) {
int32_t num = 0;
- char *file;
+ char *file = NULL;
src_get(&num, &file);
tline->text = nasm_quote(file, strlen(file));
tline->type = TOK_STRING;
diff --git a/test/_file_.asm b/test/_file_.asm
new file mode 100644
index 00000000..1ec7187b
--- /dev/null
+++ b/test/_file_.asm
@@ -0,0 +1,5 @@
+;Testname=bin; Arguments=-fbin -o_file_.bin; Files=.stdout .stderr _file_.bin
+ db __FILE__, `\r\n`
+ db __FILE__, `\r\n`
+ dw __LINE__
+ dw __LINE__