src/Helpers.c
unsigned int UnSlashLowOctal(char* s) {
  char* sStart = s;
  char* o = s;
  while (*s) {
    if ((s[0] == '\\') && (s[1] == '\\')) { // esc seq
      *o = *s; ++o; ++s; *o = *s;
    }
    else if ((s[0] == '\\') && (s[1] == '0') && IsOctalDigit(s[2]) && IsOctalDigit(s[3])) {
      *o = (char)(8 * (s[2] - '0') + (s[3] - '0'));
      s += 3;
    }
    else {
      *o = *s;
    }
    ++o;
    if (*s)
      ++s;
  }
  *o = '\0';
  return (unsigned int)(o - sStart);
}
/**
 * Convert C style \0oo into their indicated characters.
 * This is used to get control characters into the regular expresion engine
 * w/o interfering with group referencing ('\0').
 */
Convert C style \0oo into their indicated characters.
This is used to get control characters into the regular expresion engine
w/o interfering with group referencing ('\0').
Convert C style \ 0oo into their indicated characters . This is used to get control characters into the regular expresion engine w / o interfering with group referencing ( ' \ 0 ' ) .
unsigned int UnSlashLowOctal(char* s) {
  char* sStart = s;
  char* o = s;
  while (*s) {
    if ((s[0] == '\\') && (s[1] == '\\')) { 
      *o = *s; ++o; ++s; *o = *s;
    }
    else if ((s[0] == '\\') && (s[1] == '0') && IsOctalDigit(s[2]) && IsOctalDigit(s[3])) {
      *o = (char)(8 * (s[2] - '0') + (s[3] - '0'));
      s += 3;
    }
    else {
      *o = *s;
    }
    ++o;
    if (*s)
      ++s;
  }
  *o = '\0';
  return (unsigned int)(o - sStart);
}
unsigned int UnSlashLowOctal ( char * s ) { char * sStart = s ; char * o = s ; while ( * s ) { if ( ( s [ 0 ] == ' \\ ' ) && ( s [ 1 ] == ' \\ ' ) ) { * o = * s ; ++ o ; ++ s ; * o = * s ; } else if ( ( s [ 0 ] == ' \\ ' ) && ( s [ 1 ] == ' ' ) && IsOctalDigit ( s [ 2 ] ) && IsOctalDigit ( s [ 3 ] ) ) { * o = ( char ) ( 8 * ( s [ 2 ] - ' ' ) + ( s [ 3 ] - ' ' ) ) ; s += 3 ; } else { * o = * s ; } ++ o ; if ( * s ) ++ s ; } * o = ' \0 ' ; return ( unsigned int ) ( o - sStart ) ; }
Convert C style \0oo into their indicated characters.
Convert C style \ 0oo into their indicated characters .
// esc seq