IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 17, 2006, 5:04:25 PM (20 years ago)
Author:
eugene
Message:

added additional chars to whitespace checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/header/F_scan.c

    r7054 r10073  
    4242    Nchar = MIN (80, p + 80 - q);
    4343    memcpy (tmp, q, Nchar);
    44     gfits_stripwhite (tmp);
     44    stripwhite (tmp);
    4545    strcpy (va_arg (argp, char *), tmp);
    4646    return (TRUE);
     
    5555    bzero (tmp, 81);
    5656    memcpy (tmp, s, Nchar);
    57     gfits_stripwhite (tmp);
     57    stripwhite (tmp);
    5858    strcpy (va_arg (argp, char *), tmp);
    5959    return (TRUE);
     
    9494/* if the variable argument stuff breaks on another system, look
    9595at F_modify.c as it has the old code */
    96 
    97 #ifndef whitespace
    98 #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
    99 #endif
    100 
    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.