src/aggregate/expr/exprast.c
// unquote and unescape a stirng literal, and return a cleaned copy of it
unquote and unescape a stirng literal, and return a cleaned copy of it
unquote and unescape a stirng literal and return a cleaned copy of it
char *unescpeStringDup(const char *s, size_t sz) {
  char *dst = malloc(sz);
  char *dstStart = dst;
  char *src = (char *)s + 1;       
  char *end = (char *)s + sz - 1;  
  while (src < end) {
    if (*src == '\\' && src + 1 < end && (ispunct(*(src + 1)) || isspace(*(src + 1)))) {
      ++src;
      continue;
    }
    *dst++ = *src++;
  }
  *dst = '\0';
  return dstStart;
}
char * unescpeStringDup ( const char * s , size_t sz ) { char * dst = malloc ( sz ) ; char * dstStart = dst ; char * src = ( char * ) s + 1 ; char * end = ( char * ) s + sz - 1 ; while ( src < end ) { if ( * src == ' \\ ' && src + 1 < end && ( ispunct ( * ( src + 1 ) ) || isspace ( * ( src + 1 ) ) ) ) { ++ src ; continue ; } * dst ++ = * src ++ ; } * dst = ' \0 ' ; return dstStart ; }
unquote and unescape a stirng literal, and return a cleaned copy of it
unquote and unescape a stirng literal and return a cleaned copy of it
// we start after the first quote // we end at the last quote // unescape