From 9205d8c99b0e9ad6710c114cf14ec83feff10f59 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 9 Jun 2006 20:31:19 +0000 Subject: libgloss/ * m68k/bdm-system.c (_system): Support system(NULL). --- ChangeLog.csl | 5 +++++ libgloss/m68k/bdm-system.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog.csl b/ChangeLog.csl index 3768c4c2b..5321d9bc0 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,8 @@ +2006-06-09 Nathan Sidwell + + libgloss/ + * m68k/bdm-system.c (_system): Support system(NULL). + 2006-06-09 Sandra Loosemore * newlib/libc/sys/arm/syscalls.c (_unlink, isatty, _system, _rename): diff --git a/libgloss/m68k/bdm-system.c b/libgloss/m68k/bdm-system.c index 433713072..75a82e2a7 100644 --- a/libgloss/m68k/bdm-system.c +++ b/libgloss/m68k/bdm-system.c @@ -36,11 +36,11 @@ int _system (const char *command) gdb_parambuf_t parameters; parameters[0] = (uint32_t) command; - parameters[1] = (uint32_t) strlen (command) + 1; + parameters[1] = command ? (uint32_t) strlen (command) + 1 : 0; BDM_TRAP (BDM_SYSTEM, (uint32_t)parameters); errno = convert_from_gdb_errno (parameters[1]); e = parameters[0]; - if (e >= 0) + if (e >= 0 && command) { /* We have to convert e, an exit status to the encoded status of the command. To avoid hard coding the exit status, we simply -- cgit v1.2.3