GermainZ / xdg-desktop-portal-termfilechooser

xdg-desktop-portal backend for choosing files with your favorite file chooser
MIT License
71 stars 16 forks source link

Fix line counting #2

Closed timhallmann closed 3 months ago

timhallmann commented 2 years ago

Instead of skipping every other char (and thus possibly newlines), skip only immediately after a newline.

N-R-K commented 1 year ago

Also cr needs to be an int not a char if you want to reliably store EOF (notice that getchar() returns an int and not a char specifically due to this reason). More detailed info: https://c-faq.com/stdio/getcharc.html