+2017-10-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/82233
+ * gfortran.dg/execute_command_line_3.f90: New test.
+
2017-10-10 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpc/fold-vec-splat-16.c: New
--- /dev/null
+! { dg-do run }
+! PR 82233 - there were program aborts for some of these commands.
+! Original test case by Urban Jost.
+program boom
+implicit none
+integer :: i,j
+character(len=256) :: msg
+character(len=:), allocatable :: command
+ command='notthere'
+ msg='' ! seems to only be defined if exitstatus.ne.0
+ ! ok -- these work
+ call execute_command_line(command , wait=.false., exitstat=i, cmdstat=j, cmdmsg=msg)
+ if (j /= 0 .or. msg /= '') call abort
+ call execute_command_line(command , exitstat=i, cmdstat=j, cmdmsg=msg )
+ if (j /= 3 .or. msg /= "Invalid command line" ) call abort
+ msg = ''
+ call execute_command_line(command , wait=.false., exitstat=i, cmdmsg=msg )
+ print *,msg
+ if (msg /= '') call abort
+ call execute_command_line(command , exitstat=i, cmdstat=j )
+ if (j /= 3) call abort
+ call execute_command_line(command , wait=.false., exitstat=i )
+
+end program boom
+2017-10-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/82233
+ * intrinsics/execute_command_line.c (execute_command_line):
+ No call to runtime_error if cmdstat is present.
+
2017-09-24 Dominique d'Humieres <dominiq@lps.ens.fr>
PR libgfortran/79612
free (cmd);
/* Now copy back to the Fortran string if needed. */
- if (cmdstat && *cmdstat > EXEC_NOERROR)
- {
- if (cmdmsg)
- fstrcpy (cmdmsg, cmdmsg_len, cmdmsg_values[*cmdstat],
+ if (cmdstat && *cmdstat > EXEC_NOERROR && cmdmsg)
+ fstrcpy (cmdmsg, cmdmsg_len, cmdmsg_values[*cmdstat],
strlen (cmdmsg_values[*cmdstat]));
- else
- runtime_error ("Failure in EXECUTE_COMMAND_LINE: %s",
- cmdmsg_values[*cmdstat]);
- }
}