From 0e05c303e5c3c7882d5e36a4d5b66f0563ae6478 Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Wed, 17 Sep 2014 00:40:28 +0300 Subject: PR libfortran/62768 Handle filenames with embedded null characters. testsuite ChangeLog: 2014-09-17 Janne Blomqvist PR libfortran/62768 * gfortran.dg/filename_null.f90: New test. libgfortran ChangeLog: 2014-09-17 Janne Blomqvist PR libfortran/62768 * io/io.h (gfc_unit): Store C string for the filename. * io/close.c (st_close): Use gfc_unit.filename. * io/inquire.c (inquire_via_unit): Likewise. * io/open.c (new_unit): Likewise. (already_open): Likewise, unlink file before freeing filename. * io/unit.c (init_units): Likewise. (close_unit_1): Likewise. (filename_from_unit): Likewise. * io/unix.c (compare_file_filename): Likewise. (find_file0): Likewise. (delete_file): Likewise. From-SVN: r215307 --- libgfortran/io/io.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libgfortran/io/io.h') diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index 4e71d49..1e0d092 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -567,8 +567,9 @@ typedef struct gfc_unit array_loop_spec *ls; int rank; - int file_len; - char *file; + /* Name of the file at the time OPEN was executed, as a + null-terminated C string. */ + char *filename; /* The format hash table. */ struct format_hash_entry format_hash_table[FORMAT_HASH_SIZE]; -- cgit v1.1