Files
mercury/util
Peter Wang de4d72f270 Handle argv[0] == NULL.
On some operating systems, e.g. Linux, it is possible to enter main()
with argv[0] == NULL if the parent process calls execve() with
argv[0] == NULL, or equivalently, passing NULL for the argv parameter.

runtime/mercury_wrapper.c:
runtime/mercury_wrapper.h:
    Do not assume argc > 0 and argv[0] != NULL in MR_process_args.
    If argv[0] is NULL then set MR_progname to the empty string
    so users of MR_progname can assume it points to a valid string.

    Add a new global variable MR_progname_is_known to indicate if
    argv[0] was NULL or not.

library/io.m:
    Make io.progname return the default program name if argv[0] was
    NULL.

util/mkinit.c:
    Set MR_progname to a valid string if argv[0] is NULL.
    This is not actually necessary, since, in that case, the subsequent
    call to parse_options() would immediately exit the program
    as no file names will be found in argv.
2022-01-31 20:36:53 +11:00
..
2020-10-27 11:10:11 +11:00
2020-10-27 11:10:11 +11:00
2022-01-31 20:36:53 +11:00
2020-10-27 11:10:11 +11:00