command_line_up get_command_line (enum command_control_type type, const char *arg) { /* Allocate and build a new command line structure. */ command_line_up cmd (build_command_line (type, arg)); /* Read in the body of this command. */ if (recurse_read_control_structure (read_next_line, cmd.get (), 0, 0) == invalid_control) { warning (_("Error reading in canned sequence of commands.")); return NULL; } return cmd; }
struct command_line * get_command_line (enum command_control_type type, char *arg) { struct command_line *cmd; struct cleanup *old_chain = NULL; /* Allocate and build a new command line structure. */ cmd = build_command_line (type, arg); old_chain = make_cleanup_free_command_lines (&cmd); /* Read in the body of this command. */ if (recurse_read_control_structure (read_next_line, cmd, 0, 0) == invalid_control) { warning (_("Error reading in canned sequence of commands.")); do_cleanups (old_chain); return NULL; } discard_cleanups (old_chain); return cmd; }