aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-11 08:07:17 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-11 08:07:17 +0200
commit7a211109152e82843a59ba70b0a080ce91b9b495 (patch)
tree8c435bab85197544202b320408623e3b6316f1e6 /src/grt
parent4231913909ebc0dfd8edcfa979ef6791b0a5675a (diff)
downloadghdl-7a211109152e82843a59ba70b0a080ce91b9b495.tar.gz
ghdl-7a211109152e82843a59ba70b0a080ce91b9b495.tar.bz2
ghdl-7a211109152e82843a59ba70b0a080ce91b9b495.zip
grt: handle argc=0 in ghdl_main. Fix #1206
Diffstat (limited to 'src/grt')
-rw-r--r--src/grt/ghdl_main.adb8
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;