| 1 | /* liblouis Braille Translation and Back-Translation Library |
| 2 | |
| 3 | Copyright (C) 2026 Darren Carreras |
| 4 | |
| 5 | Copying and distribution of this file, with or without modification, |
| 6 | are permitted in any medium without royalty provided the copyright |
| 7 | notice and this notice are preserved. This file is offered as-is, |
| 8 | without any warranty. */ |
| 9 | |
| 10 | #include <config.h> |
| 11 | |
| 12 | #include <stdio.h> |
| 13 | #include "liblouis.h" |
| 14 | |
| 15 | /** |
| 16 | * These are regression tests for malformed tables that used to make |
| 17 | * Liblouis crash. |
| 18 | */ |
| 19 | int |
| 20 | main(int argc, char **argv) |
| 21 | { |
| 22 | /* The "\\#" sequence starts the replacement operand with a literal '#'; |
| 23 | * reject its trailing lone backslash without underflowing ruleDots.length. */ |
| 24 | lou_checkTable("tests/tables/bad-replace.ctb"); |
| 25 | |
| 26 | /* Reject a trailing lone backslash in the source operand. */ |
| 27 | lou_checkTable("tests/tables/bad-replace-source.ctb"); |
| 28 | |
| 29 | lou_free(); |
| 30 | |
| 31 | return 0; |
| 32 | } |