This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR libfortran/62768] Handle filenames with embedded nulls
- From: FX <fxcoudert at gmail dot com>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 16 Sep 2014 10:17:59 +0200
- Subject: Re: [PR libfortran/62768] Handle filenames with embedded nulls
- Authentication-results: sourceware.org; auth=none
- References: <CAO9iq9E75dJ2AEMfnB_Ro68FBEpYz=BjS2-fxqWNUznbCtpH+Q at mail dot gmail dot com> <CAO9iq9GP7x_sYFAzRYZryw8LEJxSBY_nrXcHHQG+BQPGJTFcZQ at mail dot gmail dot com>
>> 2014-09-05 Janne Blomqvist <jb@gcc.gnu.org>
>>
>> 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.
OK, if you add a runtime testcase.
I tried to think of other characters we might want to sanitize/special case, but at least on Unix/POSIX only NUL and / are fundamentally different. It might make sense to think about it for Windows targets.
FX