11#ifndef lint
2- static char * RCSid () { return RCSid ("$Id: command.c,v 1.283 2014/03/25 01:50:01 sfeam Exp $" ); }
2+ static char * RCSid () { return RCSid ("$Id: command.c,v 1.284 2014/03/30 18:33:21 markisch Exp $" ); }
33#endif
44
55/* GNUPLOT - command.c */
@@ -131,9 +131,6 @@ static int winsystem __PROTO((const char *));
131131# include <direct.h> /* getcwd() */
132132# else
133133# include <alloc.h>
134- # ifndef __WATCOMC__
135- # include <dir.h> /* setdisk() */
136- # endif
137134# endif /* !MSC */
138135# include <htmlhelp.h>
139136# include "win/winmain.h"
@@ -1650,7 +1647,7 @@ print_command()
16501647{
16511648 struct value a ;
16521649 /* space printed between two expressions only */
1653- int need_space = 0 ;
1650+ TBOOLEAN need_space = FALSE ;
16541651 char * dataline = NULL ;
16551652 size_t size = 256 ;
16561653
@@ -1676,32 +1673,30 @@ print_command()
16761673 }
16771674 const_express (& a );
16781675 if (a .type == STRING ) {
1679- if (dataline )
1676+ if (dataline != NULL )
16801677 strappend (& dataline , & size , a .v .string_val );
16811678 else
16821679 fputs (a .v .string_val , print_out );
16831680 gpfree_string (& a );
1684- need_space = 0 ;
1681+ need_space = FALSE ;
16851682 } else {
16861683 if (need_space ) {
1687- if (dataline )
1684+ if (dataline != NULL )
16881685 strappend (& dataline , & size , " " );
16891686 else
16901687 putc (' ' , print_out );
16911688 }
1692- if (dataline ) {
1693- char * val = value_to_str (& a , FALSE);
1694- strappend (& dataline , & size , val );
1695- } else {
1689+ if (dataline != NULL )
1690+ strappend (& dataline , & size , value_to_str (& a , FALSE));
1691+ else
16961692 disp_value (print_out , & a , FALSE);
1697- }
1698- need_space = 1 ;
1693+ need_space = TRUE;
16991694 }
17001695 } while (!END_OF_COMMAND && equals (c_token , "," ));
17011696
1702- if (dataline )
1697+ if (dataline != NULL ) {
17031698 append_to_datablock (& print_out_var -> udv_value , dataline );
1704- else {
1699+ } else {
17051700 (void ) putc ('\n' , print_out );
17061701 fflush (print_out );
17071702 }
@@ -2271,11 +2266,9 @@ changedir(char *path)
22712266 if (isalpha (path [0 ]) && (path [1 ] == ':' )) {
22722267 int driveno = toupper (path [0 ]) - 'A' ; /* 0=A, 1=B, ... */
22732268
2274- # if ( defined(MSDOS ) && defined( __EMX__ )) || defined( __MSC__ )
2269+ # if defined(__EMX__ )
22752270 (void ) _chdrive (driveno + 1 );
2276- # endif
2277-
2278- # ifdef DJGPP
2271+ # elif defined(__DJGPP__ )
22792272 (void ) setdisk (driveno );
22802273# endif
22812274 path += 2 ; /* move past drive letter */
0 commit comments