if (fieldsplit) { error = field_split_word (*word, &glob_list, ifs, ifs_white); if (*word) free (*word); } else error = w_addword (&glob_list, *word);
parse_glob (char **word, size_t *word_length, size_t *max_length,	    const char *words, size_t *offset, int flags,	    wordexp_t *pwordexp, const char *ifs, const char *ifs_white){  /* We are poised just after a '*', a '[' or a '?'. */  int error = WRDE_NOSPACE;  int quoted = 0; /* 1 if singly-quoted, 2 if doubly */  int i;  wordexp_t glob_list; /* List of words to glob */  int fieldsplit = 0;  glob_list.we_wordc = 0;  glob_list.we_wordv = NULL;  glob_list.we_offs = 0;  for (; words[*offset] != '\0'; ++*offset)    {      if (strchr (" \t\n", words[*offset]))	/* Reached end of word */	break;      /* Sort out quoting */      if (words[*offset] == '\'')	{	  if (quoted == 0)	    {	      quoted = 1;	      continue;	    }	  else if (quoted == 1)	    {	      quoted = 0;	      continue;	    }	}      else if (words[*offset] == '"')	{	  if (quoted == 0)	    {	      quoted = 2;	      continue;	    }	  else if (quoted == 2)	    {	      quoted = 0;	      continue;	    }	}      /* Sort out other special characters */      if (quoted != 1 && words[*offset] == '$')	{	  error = parse_dollars (word, word_length, max_length, words,				 offset, flags, &glob_list, ifs, ifs_white,				 quoted == 2, &fieldsplit);	  if (error)	    goto tidy_up;	  continue;	}      else if (words[*offset] == '\\')	{	  if (quoted)	    error = parse_qtd_backslash (word, word_length, max_length,					 words, offset);	  else	    error = parse_backslash (word, word_length, max_length,				     words, offset);	  if (error)	    goto tidy_up;	  continue;	}      *word = w_addchar (*word, word_length, max_length, words[*offset]);      if (*word == NULL)	goto tidy_up;    }  /* Don't forget to re-parse the character we stopped at. */  --*offset;  if (fieldsplit)    {      error = field_split_word (*word, &glob_list, ifs, ifs_white);      if (*word)	free (*word);    }  else    error = w_addword (&glob_list, *word);  /* Glob the words */  *word = w_newword (word_length, max_length);  for (i = 0; error == 0 && i < glob_list.we_wordc; i++)    error = do_parse_glob (glob_list.we_wordv[i], word, word_length,			   max_length, pwordexp, ifs, ifs_white);  /* Now tidy up */tidy_up:  wordfree (&glob_list);  return error;}