]> git.sur5r.net Git - openocd/blobdiff - src/helper/interpreter.c
- only some cosmetic changes, convert \r\n to unix
[openocd] / src / helper / interpreter.c
index 7e88263b7fa2c88b159d606b64247cd2acc7f8cf..85cd71586dcd9a820c11b58a1681d97490ededa9 100644 (file)
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "interpreter.h"
 
 #include "binarybuffer.h"
@@ -122,7 +126,7 @@ int handle_var_command(struct command_context_s *cmd_ctx, char *cmd, char **args
                        last_var_p = &((*last_var_p)->next);
                }
 
-               if ((args[0][0] >= 0) && (args[0][0] <= 9))
+               if ((args[0][0] >= '0') && (args[0][0] <= '9'))
                {
                        command_print(cmd_ctx, "invalid name specified (first character may not be a number)");
                        return ERROR_OK;
@@ -227,7 +231,7 @@ int handle_script_command(struct command_context_s *cmd_ctx, char *cmd, char **a
        echo = cmd_ctx->echo;
        cmd_ctx->echo = 1;
        
-       command_run_file(cmd_ctx, script_file, COMMAND_EXEC);
+       command_run_file(cmd_ctx, script_file, cmd_ctx->mode);
        
        cmd_ctx->echo = echo;