/[gnats]/gnats/libiberty/argv.c
ViewVC logotype

Diff of /gnats/libiberty/argv.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by jsm, Tue Oct 26 07:10:16 1999 UTC revision 1.3 by pdm, Mon Dec 10 23:03:27 2001 UTC
# Line 25  Boston, MA 02111-1307, USA.  */ Line 25  Boston, MA 02111-1307, USA.  */
25  #include "ansidecl.h"  #include "ansidecl.h"
26  #include "libiberty.h"  #include "libiberty.h"
27    
28  #ifdef isspace  #define ISBLANK(ch) ((ch) == ' ' || (ch) == '\t')
 #undef isspace  
 #endif  
 #define isspace(ch) ((ch) == ' ' || (ch) == '\t')  
29    
30  /*  Routines imported from standard C runtime libraries. */  /*  Routines imported from standard C runtime libraries. */
31    
32  #ifdef __STDC__  #ifdef __STDC__
33    
34  #include <stddef.h>  #include <stddef.h>
35  extern void *memcpy (void *s1, const void *s2, size_t n);       /* 4.11.2.1 */  #include <string.h>
36  extern size_t strlen (const char *s);                           /* 4.11.6.3 */  #include <stdlib.h>
 extern void *malloc (size_t size);                              /* 4.10.3.3 */  
 extern void *realloc (void *ptr, size_t size);                  /* 4.10.3.4 */  
 extern void free (void *ptr);                                   /* 4.10.3.2 */  
 extern char *strdup (const char *s);                            /* Non-ANSI */  
37    
38  #else   /* !__STDC__ */  #else   /* !__STDC__ */
39    
# Line 231  char *input; Line 224  char *input;
224        do        do
225          {          {
226            /* Pick off argv[argc] */            /* Pick off argv[argc] */
227            while (isspace (*input))            while (ISBLANK (*input))
228              {              {
229                input++;                input++;
230              }              }
# Line 264  char *input; Line 257  char *input;
257            arg = copybuf;            arg = copybuf;
258            while (*input != EOS)            while (*input != EOS)
259              {              {
260                if (isspace (*input) && !squote && !dquote && !bsquote)                if (ISBLANK (*input) && !squote && !dquote && !bsquote)
261                  {                  {
262                    break;                    break;
263                  }                  }
# Line 330  char *input; Line 323  char *input;
323            argc++;            argc++;
324            argv[argc] = NULL;            argv[argc] = NULL;
325    
326            while (isspace (*input))            while (ISBLANK (*input))
327              {              {
328                input++;                input++;
329              }              }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26