Skip to content

Conversation

@jserv
Copy link
Collaborator

@jserv jserv commented Aug 5, 2025

This adds proper backslash escaping in inliner.c to prevent unmatched quotes when processing strings with escaped characters and integrates norm-lf preprocessing into the build pipeline.

The key fix is in write_line() which now properly escapes backslashes before quotes, preventing corruption like:

  • Input: printf("Hello "world"\n");
  • Before: __c("printf(\"Hello \"world\"\n\");"); // Corrupted!
  • After: __c("printf(\"Hello \\\"world\\\"\\n\");"); // Correct!

Close #141

Summary by Bito

This pull request enhances the inliner tool by fixing string escaping issues and introduces a new tool, norm-lf, to normalize line endings to LF format. These changes improve string processing robustness and ensure consistent line endings across files.

@jserv jserv requested a review from ChAoSUnItY August 5, 2025 14:29
This adds proper backslash escaping in inliner.c to prevent unmatched
quotes when processing strings with escaped characters and integrates
norm-lf preprocessing into the build pipeline.

The key fix is in write_line() which now properly escapes backslashes
before quotes, preventing corruption like:
    Input:  printf("Hello \"world\"\n");
    Before: __c("printf(\"Hello \"world\"\n\");");  // Corrupted!
    After:  __c("printf(\"Hello \\\"world\\\"\\n\");");  // Correct!

Close #141
@jserv jserv force-pushed the linebreak-compat branch from 1718132 to 6f63efa Compare August 5, 2025 14:31
@jserv jserv merged commit f2d99dd into master Aug 5, 2025
12 checks passed
@jserv jserv deleted the linebreak-compat branch August 5, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to bootstrap due to corrupted libc.inc

3 participants