- fix duplicate log entry
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sun, 6 Jul 2008 23:49:05 +0000 (23:49 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sun, 6 Jul 2008 23:49:05 +0000 (23:49 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@762 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/helper/command.c

index 8b7be702421338fff62d836d4983f3d4db734df2..e30e2d38833876f86de279da7be4f3a807401b3f 100644 (file)
@@ -445,11 +445,15 @@ int command_run_line_internal_op(command_context_t *context, char *line, int run
        if (*line && (line[0] == '#'))
                return ERROR_OK;
        
-       LOG_DEBUG("%s", line);
+       if (run)
+       {
+               LOG_DEBUG("%s", line);
+       }
 
        nwords = parse_line(line, words, sizeof(words) / sizeof(words[0]));
        
        if (nwords > 0)
+       {
                if (run)
                {
                        retval = find_and_run_command(context, context->commands, words, nwords);
@@ -458,6 +462,7 @@ int command_run_line_internal_op(command_context_t *context, char *line, int run
                        int t;
                        return (find_command(context, context->commands, words, nwords, 0, &t)!=NULL)?ERROR_OK:ERROR_FAIL;
                }
+       }
        else
                return ERROR_INVALID_ARGUMENTS;