cond_expand_word (w, special)
     WORD_DESC *w;
     int special;
{
  char *r, *p;
  WORD_LIST *l;
  int qflags;

  if (w->word == 0 || w->word[0] == '\0')
    return ((char *)NULL);

  expand_no_split_dollar_star = 1;
  w->flags |= W_NOSPLIT2;
  l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0);
  expand_no_split_dollar_star = 0;
  if (l)
    {
      if (special == 0)			/* LHS */
	{
	  dequote_list (l);
	  r = string_list (l);
	}
      else
	{
	  /* Need to figure out whether or not we should call dequote_escapes
	     or a new dequote_ctlnul function here, and under what
	     circumstances. */
	  qflags = QGLOB_CVTNULL;
	  if (special == 2)
	    qflags |= QGLOB_REGEXP;
	  word_list_remove_quoted_nulls (l);
	  p = string_list (l);
	  r = quote_string_for_globbing (p, qflags);
	  free (p);
	}
      dispose_words (l);
    }
  else
    r = (char *)NULL;

  return r;
}
cond_expand_word (w, special)
     WORD_DESC *w;
     int special;
{
  char *r, *p;
  WORD_LIST *l;
  int qflags;

  if (w->word == 0 || w->word[0] == '\0')
    return ((char *)NULL);

  expand_no_split_dollar_star = 1;
  w->flags |= W_NOSPLIT2;
  l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0);
  expand_no_split_dollar_star = 0;
  if (l)
    {
      if (special == 0)			 
	{
	  dequote_list (l);
	  r = string_list (l);
	}
      else
	{
	   
	  qflags = QGLOB_CVTNULL;
	  if (special == 2)
	    qflags |= QGLOB_REGEXP;
	  word_list_remove_quoted_nulls (l);
	  p = string_list (l);
	  r = quote_string_for_globbing (p, qflags);
	  free (p);
	}
      dispose_words (l);
    }
  else
    r = (char *)NULL;

  return r;
}