gavinhoward / bc

An implementation of the POSIX bc calculator with GNU extensions and dc, moved away from GitHub. Finished, but well-maintained.
https://git.gavinhoward.com/gavin/bc
Other
145 stars 29 forks source link

Multi-line comments in files result in parse error #50

Closed DelilahHoare closed 2 years ago

DelilahHoare commented 2 years ago

Comments delimited by /* */ and spanning multiple lines in files result in Parse error: comment end cannot be found. Such comments are accepted into stdin.

gavinhoward commented 2 years ago

That does sound like a bug.

Could you send me the output of bc --version? Also, could you send me one or more files that cause it to happen?

DelilahHoare commented 2 years ago

I should clarify that this only happens when using the -f flag; passing the file as an argument without that flag works.

bc 5.2.2
Copyright (c) 2018-2021 Gavin D. Howard and contributors
Report bugs at: https://git.yzena.com/gavin/bc

This is free software with ABSOLUTELY NO WARRANTY.

testoneline.bc works, testmultiline.bc doesn't.
timeconst.bc comes from the linux source tree and also doesn't work.

gavinhoward commented 2 years ago

Thank you. I have confirmed the bug, and I'm working on debugging and a fix.

gavinhoward commented 2 years ago

Okay, I have found the problem and have committed a fix in d778d0b9177c75f207dca16b57974edbb5f9e15c and dbc4dc4c4e94712fa1d4800c81e84d6da18f5188.

Could you pull and test the updated commits for me, to make sure they work for you? In the meantime, I'll prepare a release with the fix.

DelilahHoare commented 2 years ago

It's working, thanks!

gavinhoward commented 2 years ago

Great! I'll have version 5.2.3 out in a few days.

gavinhoward commented 2 years ago

5.2.3 is out!