- added myself to copyright on files i remember adding large contributions for over...
[fw/openocd] / src / helper / configuration.c
index ff8b0272e98137e2fab21a249898453115f91b46..a8d3bd2270b2c292d49c0e840ace2542dd5a6519 100644 (file)
@@ -2,6 +2,9 @@
  *   Copyright (C) 2004, 2005 by Dominic Rath                              *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
+ *   Copyright (C) 2007,2008 Ã˜yvind Harboe                                 *
+ *   oyvind.harboe@zylin.com                                               *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -55,7 +58,7 @@ void add_config_command (const char *cfg)
 }
 
 /* return full path or NULL according to search rules */
-char *find_file(char *file)
+char *find_file(const char *file)
 {
        FILE *fp = NULL;
        char **search_dirs = script_search_dirs;
@@ -106,6 +109,7 @@ FILE *open_file_from_path (char *file, char *mode)
 
 int parse_config_file(struct command_context_s *cmd_ctx)
 {
+       int retval;
        char **cfg;
 
        if (!config_file_names)
@@ -115,7 +119,9 @@ int parse_config_file(struct command_context_s *cmd_ctx)
 
        while (*cfg)
        {
-               command_run_line(cmd_ctx, *cfg);
+               retval=command_run_line(cmd_ctx, *cfg);
+               if (retval!=ERROR_OK)
+                       return retval;
                cfg++;
        }