Allow EOL-less description lines at EOF

Mended bug where EOL-less descriptive text at the end
of a file (e.g., a stamp description) would get ignored.

Closes https://sourceforge.net/p/tuxpaint/bugs/298/
h/t Laura
This commit is contained in:
Bill Kendrick 2025-06-06 20:55:01 -07:00
parent 742ab6ddaa
commit cab4394173
2 changed files with 35 additions and 33 deletions

View file

@ -14,6 +14,11 @@ https://tuxpaint.org/
Closes https://sourceforge.net/p/tuxpaint/bugs/299/ Closes https://sourceforge.net/p/tuxpaint/bugs/299/
h/t Billy A. h/t Billy A.
+ Mended bug where EOL-less descriptive text at the end
of a file (e.g., a stamp description) would get ignored.
Closes https://sourceforge.net/p/tuxpaint/bugs/298/
h/t Laura
2025.May.26 (0.9.35) 2025.May.26 (0.9.35)
* New Magic Tools: * New Magic Tools:
---------------- ----------------

View file

@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
June 14, 2002 - April 19, 2025 June 14, 2002 - June 6, 2025
*/ */
#include "platform.h" #include "platform.h"
@ -13519,8 +13519,6 @@ static char *loaddesc(const char *const fname, Uint8 *locale_text)
do do
{ {
if (fgets(buf, sizeof(buf), fi)) if (fgets(buf, sizeof(buf), fi))
{
if (!feof(fi))
{ {
strip_trailing_whitespace(buf); strip_trailing_whitespace(buf);
@ -13561,7 +13559,6 @@ static char *loaddesc(const char *const fname, Uint8 *locale_text)
} }
} }
} }
}
while (!feof(fi) && !found); while (!feof(fi) && !found);
fclose(fi); fclose(fi);