Skip to content

Commit 449650c

Browse files
klauslervdonaldson
authored andcommitted
[flang] Fix INQUIRE(FILE=,NAME=)
The file name output was not being copied back to the program from the runtime. Differential Revision: https://reviews.llvm.org/D115190
1 parent 022f2b0 commit 449650c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flang/runtime/io-stmt.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,10 @@ bool InquireUnconnectedFileState::Inquire(
12021202
break;
12031203
case HashInquiryKeyword("NAME"):
12041204
str = path_.get();
1205-
return true;
1205+
if (!str) {
1206+
return true; // result is undefined
1207+
}
1208+
break;
12061209
}
12071210
if (str) {
12081211
ToFortranDefaultCharacter(result, length, str);

0 commit comments

Comments
 (0)