New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod dependency list has bad line breaks if file has Windows line-breaks on unixoid system #4720

Closed
Wuzzy2 opened this Issue Nov 3, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@Wuzzy2
Contributor

Wuzzy2 commented Nov 3, 2016

Minetest may screw up the list of mod dependencies in the main menu if the line endings of depends.txt are in “Windows” mode and Minetest runs on Linux (my system):

Dependencies Windows mode

The text seems to be a “half line” too high. The file was stored with “Windows” line endings. If I convert depends.txt to “UNIX” mode, Minetest shows it correctly:

Dependencies in UNIX mode

The source depends.txt file used for this example:

default
farming
stairs
flowers
doors
bakedclay?
moreblocks?
intllib?

(No line-break at the final line, but it makes no difference.)

Tested in 70e2df4.


My guess:
So the bug here seems to be that Minetest expects depends.txt to have “UNIX”-style line endings because I am on Linux. Ideally, Minetest should be able to deal with all 3 possible line ending types (Windows, UNIX, Mac) correctly on any system.

bernardosulzbach added a commit to bernardosulzbach/minetest that referenced this issue Dec 12, 2016

Should have platform-independent line breaking
This fixes a bug existing in modmgr.lua as reported by @Wuzzy2 which
caused the mod dependency list to glitch if input was using a line
terminator different than the OS default.

The C++ code does not need any changes as it already trims CR
occurrences on platforms on which the line termination sequence is LF.

Taken into account the size of the depends.txt files used, this should
not introduce a noticeable performance regression.

Fixes minetest#4720

@paramat paramat closed this in d9675d3 Dec 12, 2016

@paramat

This comment has been minimized.

Member

paramat commented Dec 12, 2016

#4896 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment