diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-11 08:07:17 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-11 08:07:17 +0200 |
commit | 7a211109152e82843a59ba70b0a080ce91b9b495 (patch) | |
tree | 8c435bab85197544202b320408623e3b6316f1e6 | |
parent | 4231913909ebc0dfd8edcfa979ef6791b0a5675a (diff) | |
download | ghdl-7a211109152e82843a59ba70b0a080ce91b9b495.tar.gz ghdl-7a211109152e82843a59ba70b0a080ce91b9b495.tar.bz2 ghdl-7a211109152e82843a59ba70b0a080ce91b9b495.zip |
grt: handle argc=0 in ghdl_main. Fix #1206
-rw-r--r-- | src/grt/ghdl_main.adb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/grt/ghdl_main.adb b/src/grt/ghdl_main.adb index c36e1b851..3107da23c 100644 --- a/src/grt/ghdl_main.adb +++ b/src/grt/ghdl_main.adb @@ -45,12 +45,18 @@ is (Source => System.Address, Target => Grt.Options.Argv_Type); My_Argv : Grt.Options.Argv_Type := To_Argv_Type (Argv); + Progname : Ghdl_C_String; begin -- Ada elaboration. Grt_Init; -- Set the options. - Grt.Main.Run_Options (My_Argv (0), Argc, My_Argv); + if Argc > 0 then + Progname := My_Argv (0); + else + Progname := null; + end if; + Grt.Main.Run_Options (Progname, Argc, My_Argv); -- Initialize, elaborate and simulate. Grt.Main.Run; |