diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/alg.c | 15 |
1 files changed, 13 insertions, 2 deletions
| @@ -230,6 +230,17 @@ new_alg(char *str) | |||
| 230 | continue; | 230 | continue; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | /* Single slash for comments */ | ||
| 234 | if (str[i] == '/') { | ||
| 235 | while (str[i] && str[i] != '\n') | ||
| 236 | i++; | ||
| 237 | |||
| 238 | if (!str[i]) | ||
| 239 | i--; | ||
| 240 | |||
| 241 | continue; | ||
| 242 | } | ||
| 243 | |||
| 233 | move_read = false; | 244 | move_read = false; |
| 234 | for (j = U; j < NMOVES; j++) { | 245 | for (j = U; j < NMOVES; j++) { |
| 235 | if (str[i] == move_string(j)[0] || | 246 | if (str[i] == move_string(j)[0] || |
| @@ -270,8 +281,8 @@ new_alg(char *str) | |||
| 270 | } | 281 | } |
| 271 | 282 | ||
| 272 | if (!move_read) { | 283 | if (!move_read) { |
| 273 | alg = new_alg(""); | 284 | free(alg); |
| 274 | return alg; | 285 | return new_alg(""); |
| 275 | } | 286 | } |
| 276 | } | 287 | } |
| 277 | 288 | ||
