* cp-support.c (first_component_command): Return if no arguments.

This commit is contained in:
Aleksandar Ristovski 2008-03-28 19:52:23 +00:00
parent 25755480bf
commit c836824f38
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2008-03-19 Aleksandar Ristovski <aristovski@qnx.com>
* cp-support.c (first_component_command): Return if no arguments.
2008-03-28 Carlos O'Donell <carlos@codesourcery.com>
* ser-mingw.c (ser_windows_open): Open requested name.

View File

@ -892,8 +892,14 @@ maint_cplus_command (char *arg, int from_tty)
static void
first_component_command (char *arg, int from_tty)
{
int len = cp_find_first_component (arg);
char *prefix = alloca (len + 1);
int len;
char *prefix;
if (!arg)
return;
len = cp_find_first_component (arg);
prefix = alloca (len + 1);
memcpy (prefix, arg, len);
prefix[len] = '\0';