Counts and returns the number of occurrences of "%s" in s.
| 81 | |
| 82 | // Counts and returns the number of occurrences of "%s" in s. |
| 83 | static int CountArgs(const std::string& s) { |
| 84 | const char *p = s.c_str(); |
| 85 | int n = 0; |
| 86 | while ((p = strstr(p, "%s")) != NULL) { |
| 87 | p += 2; |
| 88 | n++; |
| 89 | } |
| 90 | return n; |
| 91 | } |
| 92 | |
| 93 | // Generates all possible postfix command sequences. |
| 94 | // Each sequence is handed off to RunPostfix to generate a regular expression. |
no test coverage detected