Changeset 10073 for trunk/Ohana/src/libfits/header/F_scan.c
- Timestamp:
- Nov 17, 2006, 5:04:25 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/header/F_scan.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/header/F_scan.c
r7054 r10073 42 42 Nchar = MIN (80, p + 80 - q); 43 43 memcpy (tmp, q, Nchar); 44 gfits_stripwhite (tmp);44 stripwhite (tmp); 45 45 strcpy (va_arg (argp, char *), tmp); 46 46 return (TRUE); … … 55 55 bzero (tmp, 81); 56 56 memcpy (tmp, s, Nchar); 57 gfits_stripwhite (tmp);57 stripwhite (tmp); 58 58 strcpy (va_arg (argp, char *), tmp); 59 59 return (TRUE); … … 94 94 /* if the variable argument stuff breaks on another system, look 95 95 at F_modify.c as it has the old code */ 96 97 #ifndef whitespace98 #define whitespace(c) (((c) == ' ') || ((c) == '\t'))99 #endif100 101 /* Strip whitespace from the start and end of STRING. */102 int gfits_stripwhite (char *string) {103 104 int i;105 106 if (string == (char *) NULL)107 return (FALSE);108 109 for (i = 0; whitespace (string[i]); i++);110 if (i) memmove (string, string + i, strlen(string+i)+1);111 for (i = strlen (string) - 1; (i > 0) && whitespace (string[i]); i--);112 string[++i] = 0;113 114 return (i);115 116 }117 118 # if (0)119 one_quote = FALSE;120 tmp[0] = *(p + 10);121 if (tmp[0] == 0x27)122 one_quote = TRUE;123 /* end the string if we hit: a -- end of line (80 chars) b -- NEWLINE c -- '(0x27: single quote) (end of string) */124 for (i = 1; (i < 70) && (p[i + 10] != NEWLINE) && ((p[i + 10] != 0x27) || !one_quote); i++) {125 tmp[i] = *(p + 10 + i);126 if ((tmp[i] == 0x27) && !one_quote)127 one_quote = TRUE;128 if ((tmp[i] == 0x2f) && !one_quote)129 break;130 }131 tmp[i] = 0;132 if ((c = strchr (tmp, 0x27)) != NULL)133 *c = ' ';134 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
