diff options
author | starkos <none@none> | 2010-01-07 19:24:17 +0300 |
---|---|---|
committer | starkos <none@none> | 2010-01-07 19:24:17 +0300 |
commit | 70ae5b15fb66ae8df462f498941bb28f24dd658c (patch) | |
tree | b3ae14a9b715c6912d82c91793f7fc7236f138c3 /scripts | |
parent | 6a97bbd0b4c66bda54431a7246eb17162754fc33 (diff) |
Adjusted string length limits to build on VS2003
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/embed.lua | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/embed.lua b/scripts/embed.lua index ddb5ba4..31edad7 100644 --- a/scripts/embed.lua +++ b/scripts/embed.lua @@ -47,17 +47,23 @@ local function writefile(out, fname, contents) -- cut smaller than max, so I don't wind up with tiny strings at end of files - local cut = 8192 - local max = 9216 + local max = 2048 -- break up large strings to fit in Visual Studio's string length limit local start = 1 local len = contents:len() while start <= len do local n = len - start - if n > max then n = cut end - writeline(out, contents:sub(start, start + n)) - start = start + n + 1 + if n > max then n = max end + local finish = start + n + + -- make sure I don't cut an escape sequence + while contents:sub(finish, finish) == "\\" do + finish = finish - 1 + end + + writeline(out, contents:sub(start, finish)) + start = finish + 1 end writeline(out, "EOF:" .. fname) |