From: John Darrington Date: Fri, 1 Jul 2011 15:58:33 +0000 (+0200) Subject: Fix building when readline library is not present X-Git-Tag: v0.7.9~256 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3bb911bf13f8fb0d10c83d42e130184e0a599ab;p=pspp-builds.git Fix building when readline library is not present --- diff --git a/src/ui/terminal/terminal-reader.c b/src/ui/terminal/terminal-reader.c index 7c80d27b..db561a9a 100644 --- a/src/ui/terminal/terminal-reader.c +++ b/src/ui/terminal/terminal-reader.c @@ -153,6 +153,36 @@ terminal_reader_create (void) return &r->reader; } + + +static const char * +readline_prompt (enum prompt_style style) +{ + switch (style) + { + case PROMPT_FIRST: + return "PSPP> "; + + case PROMPT_LATER: + return " > "; + + case PROMPT_DATA: + return "data> "; + + case PROMPT_COMMENT: + return "comment> "; + + case PROMPT_DOCUMENT: + return "document> "; + + case PROMPT_DO_REPEAT: + return "DO REPEAT> "; + } + + NOT_REACHED (); +} + + #if HAVE_READLINE #include #include @@ -189,33 +219,6 @@ readline_done (void) free (history_file); } -static const char * -readline_prompt (enum prompt_style style) -{ - switch (style) - { - case PROMPT_FIRST: - return "PSPP> "; - - case PROMPT_LATER: - return " > "; - - case PROMPT_DATA: - return "data> "; - - case PROMPT_COMMENT: - return "comment> "; - - case PROMPT_DOCUMENT: - return "document> "; - - case PROMPT_DO_REPEAT: - return "DO REPEAT> "; - } - - NOT_REACHED (); -} - static struct substring readline_read (enum prompt_style style) { @@ -295,7 +298,7 @@ readline_done (void) static struct substring readline_read (enum prompt_style style) { - const char *prompt = prompt_get (style); + const char *prompt = readline_prompt (style); struct string line; fputs (prompt, stdout);