From 5c7645201d967630b80850e5f422b575de00f415 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 6 Dec 2010 20:48:32 -0800 Subject: [PATCH] ECHO: Use text_item, as intended. TEXT_ITEM_ECHO is meant for use by ECHO but it had been overlooked accidentally until now. --- src/language/utilities/echo.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) 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; } -- 2.30.2