]> git.tuebingen.mpg.de Git - adu.git/blobdiff - interactive.c
Allow comments in interactive input.
[adu.git] / interactive.c
index 28ef74a4b81cc873a3b6e4fa90a8fe15a6ebda0d..62ff5edb774ded49b643e14c4a94f72336f4115c 100644 (file)
@@ -70,6 +70,10 @@ void print_interactive_help(void)
 
 static int icom_reset(__a_unused char *line)
 {
+       free_format_info(fi);
+       fi = NULL;
+       free(admissible_uids);
+       admissible_uids = NULL;
        select_cmdline_parser_init(&select_conf);
        return 1;
 }
@@ -88,6 +92,10 @@ static int icom_set(char *line)
                return 1;
        }
 
+       free_format_info(fi);
+       fi = NULL;
+       free(admissible_uids);
+       admissible_uids = NULL;
        return parse_select_options(line, &params, &admissible_uids, &fi);
 }
 
@@ -113,6 +121,8 @@ static int exec_interactive_command(char *line)
        if (!*line)
                return 1;
        /* OK, we have a non-empty line */
+       if (*line == '#')
+               return 1;
        cmd = adu_strdup(line);
        args = cmd + strcspn(cmd, delim);
        if (!*args)