Skip to content

fbc: read tool output with LINE INPUT - #482

Open
metaneutrons wants to merge 1 commit into
freebasic:masterfrom
metaneutrons:line-input
Open

metaneutrons wants to merge 1 commit into
freebasic:masterfrom
metaneutrons:line-input

Conversation

@metaneutrons

Copy link
Copy Markdown

Summary

  • read compiler-tool output with LINE INPUT instead of record-oriented INPUT
  • preserve commas and quoted output in both affected command readers

Verification

  • built and exercised against tool output containing spaces, commas and quotes

The compiler reads what a toolchain binary prints with INPUT, which is
meant for data records: it ends the field at the first comma and strips
surrounding quotes. A path such as /opt/toolchains/gcc,15/lib/libgcc.a
comes back as /opt/toolchains/gcc, and the remainder stays in the pipe,
so a following read returns the wrong line.

Both readers are affected. hGet1stOutputLineFromCommand() feeds the
gold-linker probe, and fbcQueryCC() answers -print-libgcc-file-name,
whose result goes straight onto the link line.

Measured against realistic tool output, INPUT returns
/Users/me/My SDKs/MacOSX.sdk unharmed, so spaces are not the problem;
commas and quotes are.
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.

1 participant