MCPcopy Create free account
hub / github.com/audacity/audacity / resolve_backslashes

Function resolve_backslashes

lib-src/sqlite/shell.c:14928–14970  ·  view source on GitHub ↗

** Do C-language style dequoting. ** ** \a -> alarm ** \b -> backspace ** \t -> tab ** \n -> newline ** \v -> vertical tab ** \f -> form feed ** \r -> carriage return ** \s -> space ** \" -> " ** \' -> ' ** \\ -> backslash ** \NNN -> ascii character NNN in octal */

Source from the content-addressed store, hash-verified

14926** \NNN -> ascii character NNN in octal
14927*/
14928static void resolve_backslashes(char *z){
14929 int i, j;
14930 char c;
14931 while( *z && *z!='\\' ) z++;
14932 for(i=j=0; (c = z[i])!=0; i++, j++){
14933 if( c=='\\' && z[i+1]!=0 ){
14934 c = z[++i];
14935 if( c=='a' ){
14936 c = '\a';
14937 }else if( c=='b' ){
14938 c = '\b';
14939 }else if( c=='t' ){
14940 c = '\t';
14941 }else if( c=='n' ){
14942 c = '\n';
14943 }else if( c=='v' ){
14944 c = '\v';
14945 }else if( c=='f' ){
14946 c = '\f';
14947 }else if( c=='r' ){
14948 c = '\r';
14949 }else if( c=='"' ){
14950 c = '"';
14951 }else if( c=='\'' ){
14952 c = '\'';
14953 }else if( c=='\\' ){
14954 c = '\\';
14955 }else if( c>='0' && c<='7' ){
14956 c -= '0';
14957 if( z[i+1]>='0' && z[i+1]<='7' ){
14958 i++;
14959 c = (c<<3) + z[i] - '0';
14960 if( z[i+1]>='0' && z[i+1]<='7' ){
14961 i++;
14962 c = (c<<3) + z[i] - '0';
14963 }
14964 }
14965 }
14966 }
14967 z[j] = c;
14968 }
14969 if( j<i ) z[j] = 0;
14970}
14971
14972/*
14973** Interpret zArg as either an integer or a boolean value. Return 1 or 0

Callers 2

do_meta_commandFunction · 0.85
runOneSqlLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected