From: Ben Pfaff Date: Tue, 7 Dec 2010 04:48:32 +0000 (-0800) Subject: ECHO: Use text_item, as intended. X-Git-Tag: v0.7.7~104 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c7645201d967630b80850e5f422b575de00f415;p=pspp-builds.git ECHO: Use text_item, as intended. TEXT_ITEM_ECHO is meant for use by ECHO but it had been overlooked accidentally until now. --- diff --git a/src/language/utilities/echo.c b/src/language/utilities/echo.c index 149cc0eb..88ece636 100644 --- a/src/language/utilities/echo.c +++ b/src/language/utilities/echo.c @@ -15,28 +15,24 @@ along with this program. If not, see . */ #include -#include -#include -#include -#include -#include -#include "xalloc.h" +#include "language/command.h" +#include "language/lexer/lexer.h" +#include "libpspp/message.h" +#include "libpspp/str.h" +#include "output/text-item.h" + +#include "gl/xalloc.h" /* Echos a string to the output stream */ int cmd_echo (struct lexer *lexer, struct dataset *ds UNUSED) { - struct tab_table *tab; - if (!lex_force_string (lexer)) return CMD_FAILURE; - tab = tab_create(1, 1); - - tab_text (tab, 0, 0, 0, lex_tokcstr (lexer)); - - tab_submit(tab); + text_item_submit (text_item_create (TEXT_ITEM_ECHO, lex_tokcstr (lexer))); + lex_get (lexer); return CMD_SUCCESS; }