regions.c
/*
 *
 * RegionsClip -- save the regions without the enclosing brackets
 *
 */
- save the regions without the enclosing brackets
- save the regions without the enclosing brackets
static char *_RegionsClip(char *regstr){
  char *tbuf;
  char *tptr;
  char *oregstr;
  int len;
  int i;
  if( !regstr || !*regstr ){
    return NULL;
  }
  tbuf = xstrdup(regstr);
  nowhite(tbuf, tbuf);
  tptr = tbuf;
  if( *tbuf == '[' ){
    tptr++;
    len = strlen(tptr);
    for(i=len-1; i>=0; i-- ){
      if( tptr[i] == ']' ){
	tptr[i] = '\0';
	break;
      }
    }
  }
  oregstr = xcalloc(strlen(tptr)+1, sizeof(char));
  nowhite(tptr, oregstr);
  xfree(tbuf);
  return oregstr;
}
static char * _RegionsClip ( char * regstr ) { char * tbuf ; char * tptr ; char * oregstr ; int len ; int i ; if ( ! regstr || ! * regstr ) { return NULL ; } tbuf = xstrdup ( regstr ) ; nowhite ( tbuf , tbuf ) ; tptr = tbuf ; if ( * tbuf == ' ' ) { tptr ++ ; len = strlen ( tptr ) ; for ( i = len - 1 ; i >= 0 ; i -- ) { if ( tptr [ i ] == ' ' ) { tptr [ i ] = ' \0 ' ; break ; } } } oregstr = xcalloc ( strlen ( tptr ) + 1 , sizeof ( char ) ) ; nowhite ( tptr , oregstr ) ; xfree ( tbuf ) ; return oregstr ; }
RegionsClip -- save the regions without the enclosing brackets
RegionsClip -- save the regions without the enclosing brackets
/* check for the obvious */ /* save regions, but without the enclosing brackets */