| 132 | } |
| 133 | |
| 134 | static bool read_bool(const substr& s, bool def) |
| 135 | { |
| 136 | static const substr positive[6] = { { "yes", 3 }, { "y", 1 }, { "1", 1 }, |
| 137 | { "true", 4 }, { "t", 1 }, { "on", 2 } |
| 138 | |
| 139 | }; |
| 140 | static const substr negative[6] = { { "no", 3 }, { "n", 1 }, { "0", 1 }, |
| 141 | { "false", 5 }, { "f", 1 }, { "off", 3 } |
| 142 | |
| 143 | }; |
| 144 | if (def) |
| 145 | { |
| 146 | for (U32 i = 0; i < 6; i++) |
| 147 | { |
| 148 | if (icompare(s, negative[i]) == 0) |
| 149 | { |
| 150 | return false; |
| 151 | } |
| 152 | } |
| 153 | return true; |
| 154 | } |
| 155 | else |
| 156 | { |
| 157 | for (U32 i = 0; i < 6; i++) |
| 158 | { |
| 159 | if (icompare(s, positive[i]) == 0) |
| 160 | { |
| 161 | return true; |
| 162 | } |
| 163 | } |
| 164 | return false; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | static void reset_auto_wait() |
| 169 | { |
no test coverage detected