Escape a string for safe insertion into a Meson .ini value. Meson INI uses single-quoted strings; backslashes need doubling and single quotes need escaping. Windows absolute paths are the common case.
(value: str)
| 508 | |
| 509 | |
| 510 | def _escape_meson_string(value: str) -> str: |
| 511 | """Escape a string for safe insertion into a Meson .ini value. |
| 512 | |
| 513 | Meson INI uses single-quoted strings; backslashes need doubling and |
| 514 | single quotes need escaping. Windows absolute paths are the common case. |
| 515 | """ |
| 516 | return value.replace("\\", "\\\\").replace("'", "\\'") |
| 517 | |
| 518 | |
| 519 | _emscripten_patch_applied = False |
no outgoing calls
no test coverage detected