ada: Fix Ada.Text_IO.Delete with "encoding=8bits" form
commita5fbba52e98f8685220ce13d06716cde2ed6a598
authorRonan Desplanques <desplanques@adacore.com>
Mon, 23 Oct 2023 14:02:07 +0000 (23 16:02 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 21 Nov 2023 09:57:40 +0000 (21 10:57 +0100)
tree470066407b78b457c93ef45d589049e862f8c307
parent50e0095904e0c66b24c205a7d776e6366bc9c7c0
ada: Fix Ada.Text_IO.Delete with "encoding=8bits" form

Before this patch, on Windows, file with non-ASCII Latin1 names could be created
with Ada.Text_IO.Create by passing "encoding=8bits" through the Form
parameter and a Latin1-encoded string through the Name parameter,
but calling Ada.Text_IO.Delete on them raised an illegitimate exception.

This patch fixes this by making the wrappers of the unlink system function
aware of the encoding value passed through the Form parameter. It also
removes an unnecessary curly-brace block.

gcc/ada/

* adaint.c (__gnat_unlink): Add new parameter and fix text
conversion on Windows. Remove unnecessary curly braces.
* adaint.h (__gnat_unlink): Add new parameter.
* libgnat/i-cstrea.ads (unlink): Adapt to __gnat_unlink signature
change.
* libgnat/i-cstrea.adb (unlink): New Subprogram definition.
* libgnat/s-crtl.ads (unlink): Adapt to __gnat_unlink signature
change.
* libgnat/s-fileio.adb (Delete): Pass encoding argument to unlink.
gcc/ada/adaint.c
gcc/ada/adaint.h
gcc/ada/libgnat/i-cstrea.adb
gcc/ada/libgnat/i-cstrea.ads
gcc/ada/libgnat/s-crtl.ads
gcc/ada/libgnat/s-fileio.adb