Repository navigation
libobs/util: Order empty strrefs consistently in strref compares - #60
Merged
Merged
Conversation
strref_cmp_strref and strref_cmpi_strref return -1 in both argument orders when only one side is empty. Pin the symmetric ordering instead: an empty strref sorts before any non-empty one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
strref_cmp_strref and strref_cmpi_strref returned -1 when only the second argument was empty, so a < b and b < a both held. Return 1 in that case: an empty strref sorts before any non-empty one. The libobs callers (cf-lexer.c) only test for equality, so they are unaffected. Refs #48 Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=5487fcc96d2f29fc918f7b7d7c4c9d1f091e0792 secs=50 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791572951,"gate":"rust/all/fmt","host":"linux-x86_64","key":"c92076d5c8ebbbb14091aba093326bc3b8c0dab6c4a7ef6827806be5673861aa","lane":"lint","parents":["af177a72d18f5a2324c752996a2b81fab52bd676"],"secs":24,"stamp":"590a2b4ca864fa23ec6de7f766ef1b2c","tree":"5487fcc96d2f29fc918f7b7d7c4c9d1f091e0792","v":1,"via":"run"} Ci-Attestation: {"at":1791572951,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"c92076d5c8ebbbb14091aba093326bc3b8c0dab6c4a7ef6827806be5673861aa","lane":"lint","parents":["af177a72d18f5a2324c752996a2b81fab52bd676"],"secs":24,"stamp":"45035cbace0533e2877f80915433e6a8","tree":"5487fcc96d2f29fc918f7b7d7c4c9d1f091e0792","v":1,"via":"run"} Ci-Attestation: {"at":1791572951,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"c90be65e80c255a85d6f1e7ef643d003db79ecfb8e7454baa3af61472cafd166","lane":"rust-test","parents":["af177a72d18f5a2324c752996a2b81fab52bd676"],"secs":7,"stamp":"b2c56eca004763a625f138163d5dffad","tree":"5487fcc96d2f29fc918f7b7d7c4c9d1f091e0792","v":1,"via":"run"} Ci-Attestation: {"at":1791572951,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"74cdace31ba9b1795446dc625ef8852cdd9250ac073dc5b9d20438ed17c5907a","lane":"tier2-linux","parents":["af177a72d18f5a2324c752996a2b81fab52bd676"],"secs":19,"stamp":"c88727c9677c11cbde6026794e1a236f","tree":"5487fcc96d2f29fc918f7b7d7c4c9d1f091e0792","v":1,"via":"run"}
This was referenced Oct 9, 2026
This was referenced Oct 9, 2026
zackees
added a commit
to b7216309-jpg/obs-studio
that referenced
this pull request
Oct 10, 2026
Master fixed two C quirks the lexer/cf-tokenizer ports had characterized: strref_cmp_strref/strref_cmpi_strref now return 1 when only the second strref is empty (obs-rust#60), and cf_literal_to_str stops at the closing quote instead of leaking it after an escape (obs-rust#54). Port both and update the Tier 1 expectations; the parity tests against the C oracle now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=9874c935622b730ed6d379839d9f915d56e798b3 secs=224 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791594138,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"a22cae91b0249b5e859a421ca897e8fd","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"471d8b65186d7a73df15372fccf1b3a7","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4662bfe636941c7c447f693a2a9dfbfbc3a5f774ebeb35beb5b6f1ce1505fe18","lane":"rust-test","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":9,"stamp":"ecf6eb5030963f9c781847ca5d827a4d","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ef54c86046561303c8f0d16ffbea3153bcc655b71505abadc807552ae804490c","lane":"tier2-linux","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":202,"stamp":"db5686daffeecb4e1a158a5012812ec5","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"}
b7216309-jpg
pushed a commit
to b7216309-jpg/obs-studio
that referenced
this pull request
Oct 10, 2026
Master fixed two C quirks the lexer/cf-tokenizer ports had characterized: strref_cmp_strref/strref_cmpi_strref now return 1 when only the second strref is empty (obs-rust#60), and cf_literal_to_str stops at the closing quote instead of leaking it after an escape (obs-rust#54). Port both and update the Tier 1 expectations; the parity tests against the C oracle now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=9874c935622b730ed6d379839d9f915d56e798b3 secs=224 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791594138,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"a22cae91b0249b5e859a421ca897e8fd","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"471d8b65186d7a73df15372fccf1b3a7","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4662bfe636941c7c447f693a2a9dfbfbc3a5f774ebeb35beb5b6f1ce1505fe18","lane":"rust-test","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":9,"stamp":"ecf6eb5030963f9c781847ca5d827a4d","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ef54c86046561303c8f0d16ffbea3153bcc655b71505abadc807552ae804490c","lane":"tier2-linux","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":202,"stamp":"db5686daffeecb4e1a158a5012812ec5","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"}
b7216309-jpg
pushed a commit
to b7216309-jpg/obs-studio
that referenced
this pull request
Oct 10, 2026
Master fixed two C quirks the lexer/cf-tokenizer ports had characterized: strref_cmp_strref/strref_cmpi_strref now return 1 when only the second strref is empty (obs-rust#60), and cf_literal_to_str stops at the closing quote instead of leaking it after an escape (obs-rust#54). Port both and update the Tier 1 expectations; the parity tests against the C oracle now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=9874c935622b730ed6d379839d9f915d56e798b3 secs=224 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791594138,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"a22cae91b0249b5e859a421ca897e8fd","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"471d8b65186d7a73df15372fccf1b3a7","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4662bfe636941c7c447f693a2a9dfbfbc3a5f774ebeb35beb5b6f1ce1505fe18","lane":"rust-test","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":9,"stamp":"ecf6eb5030963f9c781847ca5d827a4d","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ef54c86046561303c8f0d16ffbea3153bcc655b71505abadc807552ae804490c","lane":"tier2-linux","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":202,"stamp":"db5686daffeecb4e1a158a5012812ec5","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"}
zackees
added a commit
to b7216309-jpg/obs-studio
that referenced
this pull request
Oct 10, 2026
Master fixed two C quirks the lexer/cf-tokenizer ports had characterized: strref_cmp_strref/strref_cmpi_strref now return 1 when only the second strref is empty (obs-rust#60), and cf_literal_to_str stops at the closing quote instead of leaking it after an escape (obs-rust#54). Port both and update the Tier 1 expectations; the parity tests against the C oracle now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=9874c935622b730ed6d379839d9f915d56e798b3 secs=224 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791594138,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"a22cae91b0249b5e859a421ca897e8fd","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"471d8b65186d7a73df15372fccf1b3a7","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4662bfe636941c7c447f693a2a9dfbfbc3a5f774ebeb35beb5b6f1ce1505fe18","lane":"rust-test","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":9,"stamp":"ecf6eb5030963f9c781847ca5d827a4d","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ef54c86046561303c8f0d16ffbea3153bcc655b71505abadc807552ae804490c","lane":"tier2-linux","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":202,"stamp":"db5686daffeecb4e1a158a5012812ec5","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"}
zackees
added a commit
to b7216309-jpg/obs-studio
that referenced
this pull request
Oct 10, 2026
Master fixed two C quirks the lexer/cf-tokenizer ports had characterized: strref_cmp_strref/strref_cmpi_strref now return 1 when only the second strref is empty (obs-rust#60), and cf_literal_to_str stops at the closing quote instead of leaking it after an escape (obs-rust#54). Port both and update the Tier 1 expectations; the parity tests against the C oracle now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=9874c935622b730ed6d379839d9f915d56e798b3 secs=224 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791594138,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"a22cae91b0249b5e859a421ca897e8fd","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"471d8b65186d7a73df15372fccf1b3a7","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4662bfe636941c7c447f693a2a9dfbfbc3a5f774ebeb35beb5b6f1ce1505fe18","lane":"rust-test","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":9,"stamp":"ecf6eb5030963f9c781847ca5d827a4d","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ef54c86046561303c8f0d16ffbea3153bcc655b71505abadc807552ae804490c","lane":"tier2-linux","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":202,"stamp":"db5686daffeecb4e1a158a5012812ec5","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"}
zackees
added a commit
to b7216309-jpg/obs-studio
that referenced
this pull request
Oct 10, 2026
Master fixed two C quirks the lexer/cf-tokenizer ports had characterized: strref_cmp_strref/strref_cmpi_strref now return 1 when only the second strref is empty (obs-rust#60), and cf_literal_to_str stops at the closing quote instead of leaking it after an escape (obs-rust#54). Port both and update the Tier 1 expectations; the parity tests against the C oracle now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=9874c935622b730ed6d379839d9f915d56e798b3 secs=224 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791594138,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"a22cae91b0249b5e859a421ca897e8fd","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"471d8b65186d7a73df15372fccf1b3a7","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4662bfe636941c7c447f693a2a9dfbfbc3a5f774ebeb35beb5b6f1ce1505fe18","lane":"rust-test","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":9,"stamp":"ecf6eb5030963f9c781847ca5d827a4d","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ef54c86046561303c8f0d16ffbea3153bcc655b71505abadc807552ae804490c","lane":"tier2-linux","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":202,"stamp":"db5686daffeecb4e1a158a5012812ec5","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"}
zackees
added a commit
to b7216309-jpg/obs-studio
that referenced
this pull request
Oct 10, 2026
Master fixed two C quirks the lexer/cf-tokenizer ports had characterized: strref_cmp_strref/strref_cmpi_strref now return 1 when only the second strref is empty (obs-rust#60), and cf_literal_to_str stops at the closing quote instead of leaking it after an escape (obs-rust#54). Port both and update the Tier 1 expectations; the parity tests against the C oracle now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=9874c935622b730ed6d379839d9f915d56e798b3 secs=224 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791594138,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"a22cae91b0249b5e859a421ca897e8fd","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ac36a3c1acd427fb1911ead460f0f8b178efbcd860f29200095c0fceacb3d5af","lane":"lint","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":13,"stamp":"471d8b65186d7a73df15372fccf1b3a7","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4662bfe636941c7c447f693a2a9dfbfbc3a5f774ebeb35beb5b6f1ce1505fe18","lane":"rust-test","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":9,"stamp":"ecf6eb5030963f9c781847ca5d827a4d","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"} Ci-Attestation: {"at":1791594138,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ef54c86046561303c8f0d16ffbea3153bcc655b71505abadc807552ae804490c","lane":"tier2-linux","parents":["6cee7a166df292724082d88354bef9dd5885b736"],"secs":202,"stamp":"db5686daffeecb4e1a158a5012812ec5","tree":"9874c935622b730ed6d379839d9f915d56e798b3","v":1,"via":"run"}
zackees
added a commit
to b7216309-jpg/obs-studio
that referenced
this pull request
Oct 10, 2026
Master fixed two C quirks the lexer/cf-tokenizer ports had characterized: strref_cmp_strref/strref_cmpi_strref now return 1 when only the second strref is empty (obs-rust#60), and cf_literal_to_str stops at the closing quote instead of leaking it after an escape (obs-rust#54). Port both and update the Tier 1 expectations; the parity tests against the C oracle now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=b9700f40fdf2c959859b23729ac355aac18f8611 secs=94 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791659811,"gate":"rust/all/fmt","host":"linux-x86_64","key":"80b41cabc2b99754af82351b24464077a0f2c3b5e8e0435931a367feff4ba543","lane":"lint","parents":["24c28c018467ba0a96fa769c9dad315b93364ee6"],"secs":21,"stamp":"e78152623289d105c70f3f12be5fbaa3","tree":"b9700f40fdf2c959859b23729ac355aac18f8611","v":1,"via":"run"} Ci-Attestation: {"at":1791659811,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"80b41cabc2b99754af82351b24464077a0f2c3b5e8e0435931a367feff4ba543","lane":"lint","parents":["24c28c018467ba0a96fa769c9dad315b93364ee6"],"secs":21,"stamp":"b968c0775d5f1beddcf661bf919941da","tree":"b9700f40fdf2c959859b23729ac355aac18f8611","v":1,"via":"run"} Ci-Attestation: {"at":1791659811,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"caf8e4acd1f26e9c504c4828ce9275052454638ab4735c03c11aba9d7e9b72f2","lane":"rust-test","parents":["24c28c018467ba0a96fa769c9dad315b93364ee6"],"secs":21,"stamp":"709942d4b526e2d335967e90ca1a2d42","tree":"b9700f40fdf2c959859b23729ac355aac18f8611","v":1,"via":"run"} Ci-Attestation: {"at":1791659811,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"127862c3824d34ae1b11b28ac0aa24185302d5538923458e438655efe47de3ef","lane":"tier2-linux","parents":["24c28c018467ba0a96fa769c9dad315b93364ee6"],"secs":52,"stamp":"cb6ddd2624a4bf11e4728568e684301c","tree":"b9700f40fdf2c959859b23729ac355aac18f8611","v":1,"via":"run"}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the second half of #48. The first half,
cf_literal_to_str, is in #54.strref_cmp_strrefandstrref_cmpi_strrefreturned -1 when only the second argument was empty, socmp(a, empty)andcmp(empty, a)were both -1. #48 asked whether to fix this in C or preserve it. This PR fixes it: an empty strref now sorts before any non-empty one in both argument orders, so the result is 1 when only the second argument is empty. The libobs callers (cf-lexer.c) only test== 0, so their behaviour doesn't change.Test first: the first commit changes the pinned
test_lexer.cassertions, which #48 explicitly says to update. With the oldlexer.cthat test fails (strref_cmp_strref_test,strref_cmpi_strref_test). The second commit fixes it.rust/tools/linux-validate/run.sh: 22/22 pass with OFF and ON, and both builds export the same 1752 symbols. The local gate is stamped.Note for the lexer port (#41): the port and its C oracle copy (
rust/obs-c-oracle/oracle/lexer.c) should adopt the symmetric ordering.🤖 Generated with Claude Code