ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/fputword.c
(Generate patch)

Comparing ray/src/common/fputword.c (file contents):
Revision 3.7 by schorsch, Thu Jul 17 09:21:29 2003 UTC vs.
Revision 3.10 by greg, Fri Nov 13 01:06:14 2020 UTC

# Line 2 | Line 2
2   static const char       RCSid[] = "$Id$";
3   #endif
4   /*
5 < * Read white space separated words from stream
5 > * Write word to stream, quoting as necessary
6   *
7   *  External symbols declared in rtio.h
8   */
# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10   #include "copyright.h"
11  
12   #include <ctype.h>
13 #include <stdio.h>
13  
14   #include "rtio.h"
15  
# Line 26 | Line 25 | FILE  *fp;
25          for (cp = s; *cp; cp++)
26                  if (isspace(*cp))
27                          hasspace++;
28 <                else if (*cp == '"')
28 >                else if ((cp > s) & (*cp == '"') && cp[1])
29                          quote = '\'';
30 <                else if (*cp == '\'')
30 >                else if ((cp > s) & (*cp == '\'') && cp[1])
31                          quote = '"';
32  
33          if (hasspace || quote) {        /* output with quotes */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines