X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=cint%2Fginaccint.bin.cpp;h=23cb38bd3b502802ad0d1aa69e6dccae2970ff91;hp=4c134b4e7a81dcfc7eb28f48ffe96f78e7b1313f;hb=d44ad7a1e65cfb2a8ca56382609cc22b2e6e07c4;hpb=63187020f00915a25f7b2831cf25f66ca38c4999;ds=sidebyside diff --git a/cint/ginaccint.bin.cpp b/cint/ginaccint.bin.cpp index 4c134b4e..23cb38bd 100644 --- a/cint/ginaccint.bin.cpp +++ b/cint/ginaccint.bin.cpp @@ -56,14 +56,16 @@ char first_non_whitespace_char(char const * s) { int l = strlen(s); int pos = 0; - while ((pos=0) && is_whitespace_char(s[pos])) pos--; + while ((pos>=0) && is_whitespace_char(s[pos])) + pos--; return s[pos]; } @@ -86,7 +88,7 @@ G__value exec_tempfile(string const & command) fout << "{" << endl << command << endl << "}" << endl; fout.close(); G__store_undo_position(); - retval=G__exec_tempfile(tmpfilename); + retval = G__exec_tempfile(tmpfilename); G__security_recover(stdout); remove(tmpfilename); free(tmpfilename); @@ -156,7 +158,8 @@ void greeting(void) << " __, _______ requested, at this moment, for commercial use. Send e-mail to" << endl << " (__) * | . The registration is free." << endl << " ._) i N a C | The GiNaC framework is Copyright by Johannes Gutenberg Univ.," << endl - << "<-------------' Germany and licensed under the terms and conditions of the GPL." << endl << endl; + << "<-------------' Germany and licensed under the terms and conditions of the GPL." << endl + << endl; } int main(void) @@ -164,7 +167,8 @@ int main(void) char *line; char prompt[G__ONELINE]; - greeting(); + if (isatty(0)) + greeting(); atexit(cleanup); signal(SIGTERM,sigterm_handler); @@ -179,14 +183,14 @@ int main(void) while (!quit) { strcpy(prompt,"GiNaC> "); int open_braces = 0; - bool end_of_command=false; + bool end_of_command = false; string command; while (!end_of_command) { line = G__input(prompt); - + int pos = 0; - bool double_quote=false; - bool single_quote=false; + bool double_quote = false; + bool single_quote = false; while(line[pos]!='\0') { switch(line[pos]) { case '"':