MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / keyncmp

Function keyncmp

Trash/stringTable.c:46–75  ·  view source on GitHub ↗

* Compare a string to a key with quoted characters */

Source from the content-addressed store, hash-verified

44 * Compare a string to a key with quoted characters
45 */
46static __inline int
47keyncmp(char *str, char *key, INTN n)
48{
49 INTN c;
50 while (n--) {
51 c = *key++;
52 if (c == '\\') {
53 switch(c = *key++) {
54 case 'n':
55 c = '\n';
56 break;
57 case 'r':
58 c = '\r';
59 break;
60 case 't':
61 c = '\t';
62 break;
63 default:
64 break;
65 }
66 } else if (c == '\"') {
67 /* Premature end of key */
68 return 1;
69 }
70 if (c != *str++) {
71 return 1;
72 }
73 }
74 return 0;
75}
76
77static void eatThru(char val, char **table_p)
78{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected