[llvm] [Flang][runtime] Fix RENAME intrinsic, remove trailing blanks (PR #159123)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 17 02:20:36 PDT 2025
================
@@ -65,8 +65,20 @@ void RTDEF(Rename)(const Descriptor &path1, const Descriptor &path2,
char *pathDst{EnsureNullTerminated(
path2.OffsetElement(), path2.ElementBytes(), terminator)};
+ // Trim trailing blanks
----------------
jeanPerier wrote:
@kparzysz, note that you can still deal with blank terminated files on UNIX system after this patch by using `rename("test_trailing "//char(0), "new_name "//char(0))`.
This is consistent not only with gfortran, but also with IFX and nvfortran/classic flang implementations. Given this is a legacy lib3f intrinsic, we must stick to the existing behaviors here.
https://github.com/llvm/llvm-project/pull/159123
More information about the llvm-commits
mailing list