From 2edf6bafd286d631f5377f123b990f3498b4b787 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Thu, 1 Jul 2010 20:29:53 +0000 Subject: [PATCH] no white space removal in echo ' ' --- ChangeLog | 4 ++++ src/frontend/inpcom.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ac61b5bdb..72a0501e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-07-01 Holger Vogt + * src/frontend/inpcom.c : no removal of white spaces in echo lines + inside a control section + 2010-07-01 Robert Larice * src/frontend/com_sysinfo.c , * src/frontend/display.c , diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 33afeaec5..3f7f629f6 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1957,6 +1957,14 @@ inp_remove_excess_ws(struct line *deck ) struct line *c = deck; while ( c != NULL ) { if ( *c->li_line == '*' ) { c = c->li_next; continue; } + + /* exclude echo lines between .control and .endc from removing white spaces */ + if ( ciprefix( ".control", c->li_line ) ) found_control = TRUE; + if ( ciprefix( ".endc", c->li_line ) ) found_control = FALSE; + if ((found_control) && (ciprefix( "echo", c->li_line ))) { + c = c->li_next; + continue; + } c->li_line = inp_remove_ws(c->li_line); /* freed in fcn */ c = c->li_next; } @@ -4102,7 +4110,7 @@ static void inp_bsource_compat(struct line *deck) { /* allow 100p, 5MEG etc. */ dvalue = INPevaluate(&str_ptr, &error1, 1); - cvalue = tmalloc(19); + cvalue = (char*) tmalloc(19); sprintf(cvalue,"%18.10e", dvalue); /* unary -, change sign */ if (ustate == 2) {