MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / UnSlashLowOctal

Function UnSlashLowOctal

src/Helpers.c:1997–2015  ·  view source on GitHub ↗

* Convert C style \0oo into their indicated characters. * This is used to get control characters into the regular expresion engine. */

Source from the content-addressed store, hash-verified

1995 * This is used to get control characters into the regular expresion engine.
1996 */
1997unsigned int UnSlashLowOctal ( char *s )
1998{
1999 char *sStart = s;
2000 char *o = s;
2001 while ( *s ) {
2002 if ( ( s[0] == '\\' ) && ( s[1] == '0' ) && IsOctalDigit ( s[2] ) && IsOctalDigit ( s[3] ) ) {
2003 *o = ( char ) ( 8 * ( s[2] - '0' ) + ( s[3] - '0' ) );
2004 s += 3;
2005 } else {
2006 *o = *s;
2007 }
2008 o++;
2009 if ( *s ) {
2010 s++;
2011 }
2012 }
2013 *o = '\0';
2014 return ( unsigned int ) ( o - sStart );
2015}
2016
2017void TransformBackslashes ( char *pszInput, BOOL bRegEx, UINT cpEdit )
2018{

Callers 1

TransformBackslashesFunction · 0.85

Calls 1

IsOctalDigitFunction · 0.85

Tested by

no test coverage detected