com_echo.c

来自「ngspice又一个电子CAD仿真软件代码.功能更全」· C语言 代码 · 共 38 行

C
38
字号
/************** com_echo.c* $Id: com_echo.c,v 1.3 2005/05/30 20:28:30 sjborley Exp $************/#include <config.h>#include <ngspice.h>#include <wordlist.h>#include <bool.h>#include "com_echo.h"#include "quote.h"#include "streams.h"voidcom_echo(wordlist *wlist){   char*copyword;    bool nl = TRUE;    if (wlist && eq(wlist->wl_word, "-n")) {        wlist = wlist->wl_next;        nl = FALSE;    }    while (wlist) {     /*   fputs(cp_unquote(wlist->wl_word), cp_out); very bad the string allocated by cp_unquote could not be freed: memory leak*/          copyword=cp_unquote(wlist->wl_word);          fputs(copyword, cp_out);          tfree(copyword);        if (wlist->wl_next)            fputs(" ", cp_out);        wlist = wlist->wl_next;    }    if (nl)        fputs("\n", cp_out);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?