aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/ghdl_main.adb
diff options
context:
space:
mode:
authorumarcor <38422348+umarcor@users.noreply.github.com>2020-04-12 10:29:56 +0200
committerGitHub <noreply@github.com>2020-04-12 10:29:56 +0200
commit1421145c299fbfa272b58f3a82f0142793fab3b1 (patch)
tree0acdca1b845c885ee7bd55209c850179ab9e5130 /src/grt/ghdl_main.adb
parent948e23fcc54c0c0116c260fc86aae0ba583172dd (diff)
downloadghdl-1421145c299fbfa272b58f3a82f0142793fab3b1.tar.gz
ghdl-1421145c299fbfa272b58f3a82f0142793fab3b1.tar.bz2
ghdl-1421145c299fbfa272b58f3a82f0142793fab3b1.zip
grt: handle argc=0 and argv/=null in ghdl_main (#1206) (#1215)
Diffstat (limited to 'src/grt/ghdl_main.adb')
-rw-r--r--src/grt/ghdl_main.adb12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/grt/ghdl_main.adb b/src/grt/ghdl_main.adb
index 3107da23c..9a4710b4c 100644
--- a/src/grt/ghdl_main.adb
+++ b/src/grt/ghdl_main.adb
@@ -44,19 +44,17 @@ is
function To_Argv_Type is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Grt.Options.Argv_Type);
- My_Argv : Grt.Options.Argv_Type := To_Argv_Type (Argv);
- Progname : Ghdl_C_String;
+ Args : Grt.Options.Argv_Type := To_Argv_Type (Argv);
+ Progname : Ghdl_C_String := null;
begin
-- Ada elaboration.
Grt_Init;
-- Set the options.
- if Argc > 0 then
- Progname := My_Argv (0);
- else
- Progname := null;
+ if not (Argc = 0 and Args = null) then
+ Progname := Args (0);
end if;
- Grt.Main.Run_Options (Progname, Argc, My_Argv);
+ Grt.Main.Run_Options (Progname, Argc, Args);
-- Initialize, elaborate and simulate.
Grt.Main.Run;