aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaxchen32 <max_chen32@foxmail.com>2025-07-27 14:22:20 +0800
committerorwell <orwell@bleipb.de>2025-08-19 22:08:34 +0200
commitf06cbfee2621e832f53cd142032e37bc674b587b (patch)
treef903406db1a007230d574797e4a064ff110c1863
parentb2601692790cc0d4ca91c8e0d525923340feaa51 (diff)
downloadadvtrains-release-2.7.0.tar.gz
advtrains-release-2.7.0.tar.bz2
advtrains-release-2.7.0.zip
Make poconvert.lua able to handle CRLF line breaks.HEADrelease-2.7.0master
I found that poconvert.lua did not work at all on Windows. After a bit of investigation I realized that it was the CRLF line breaks, and this modification I made allows the code to cope with both CRLF, LF and CR line breaks.
-rw-r--r--advtrains/poconvert.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/advtrains/poconvert.lua b/advtrains/poconvert.lua
index 74f962e..2934a13 100644
--- a/advtrains/poconvert.lua
+++ b/advtrains/poconvert.lua
@@ -72,7 +72,7 @@ local function readcomment_add_flags(flags, s)
end
local function readcomment_aux(str, pos)
- local _, epos, sval = string.find(str, "^\n*#([^\n]*)", pos)
+ local _, epos, sval = string.find(str, "^[\r\n]*#([^\r\n]*)", pos)
if not epos then
return nil
end