]> diplodocus.org Git - nmh/blobdiff - sbr/read_switch_multiword_via_readline.c
Added missing ')'.
[nmh] / sbr / read_switch_multiword_via_readline.c
index 7fad53543fe3828636bdcde62345609d79128b61..67d405c5ef6df71bbbb2fe74969f213c2e40f68a 100644 (file)
@@ -6,6 +6,10 @@
  */
 
 #include "h/mh.h"
  */
 
 #include "h/mh.h"
+#include "read_switch_multiword_via_readline.h"
+#include "smatch.h"
+#include "brkstring.h"
+#include "ambigsw.h"
 #include "print_sw.h"
 
 #ifdef READLINE_SUPPORT
 #include "print_sw.h"
 
 #ifdef READLINE_SUPPORT
@@ -33,7 +37,7 @@ read_switch_multiword_via_readline(char *prompt, struct swit *ansp)
     rl_cmds = ansp;
 
     for (;;) {
     rl_cmds = ansp;
 
     for (;;) {
-       ans = readline(prompt);
+       ans = readline(prompt);
        /*
         * If we get an EOF, return
         */
        /*
         * If we get an EOF, return
         */
@@ -55,10 +59,10 @@ read_switch_multiword_via_readline(char *prompt, struct swit *ansp)
        cpp = brkstring(ansbuf, " ", NULL);
        switch (smatch(*cpp, ansp)) {
            case AMBIGSW:
        cpp = brkstring(ansbuf, " ", NULL);
        switch (smatch(*cpp, ansp)) {
            case AMBIGSW:
-               ambigsw(*cpp, ansp);
+               ambigsw(*cpp, ansp);
                continue;
            case UNKWNSW:
                continue;
            case UNKWNSW:
-               printf(" -%s unknown. Hit <CR> for help.\n", *cpp);
+               printf(" -%s unknown. Hit <CR> for help.\n", *cpp);
                continue;
            default:
                return cpp;
                continue;
            default:
                return cpp;
@@ -79,7 +83,7 @@ nmh_completion(const char *text, int start, int end)
     NMH_UNUSED (end);
 
     if (start == 0)
     NMH_UNUSED (end);
 
     if (start == 0)
-       return rl_completion_matches(text, nmh_command_generator);
+       return rl_completion_matches(text, nmh_command_generator);
 
     return NULL;
 }
 
     return NULL;
 }
@@ -92,12 +96,12 @@ nmh_command_generator(const char *text, int state)
     char buf[256];
 
     if (!state) {
     char buf[256];
 
     if (!state) {
-       list_index = 0;
+       list_index = 0;
        len = strlen(text);
     }
 
     while ((name = rl_cmds[list_index].sw)) {
        len = strlen(text);
     }
 
     while ((name = rl_cmds[list_index].sw)) {
-       list_index++;
+       list_index++;
        strncpy(buf, name, sizeof(buf));
        buf[sizeof(buf) - 1] = '\0';
        p = *brkstring(buf, " ", NULL);
        strncpy(buf, name, sizeof(buf));
        buf[sizeof(buf) - 1] = '\0';
        p = *brkstring(buf, " ", NULL);