Commits

insolor committed 4382b8c Merge

Merge with default

Comments (0)

Files changed (3)

 0e7dac269d334e5b24d16bd8a7a0e7889190ea30 0.0.9
 c96e6383dabb28089dd4d72712104e6e7e401bd9 0.1.1
 dc1cda75a5ed0059819dae8e0be29f7e005aea49 0.1.2
+c3645a72dcc0a1d8eca84e492683364470d038a7 0.1.3
 include std/sequence.e
 include std/map.e
 include std/convert.e
+include std/text.e -- for trim()
 
 with trace
 include patcher.e
     debug = 1
 end if
 
-if length(cmd)>2 and (cmd[3][$]='\\' or cmd[3][$]='/') then
+if length(cmd)>2 then
     path = cmd[3]
-    cmd = remove(cmd,3)
+end if
+
+-- Workaround for a bug described here: http://openeuphoria.org/ticket/897.wc
+if length(path)>0 then
+  if path[$]='\"' then
+      path=trim(path,'\"')
+  end if
+
+  if path[$]!='\\' then
+      path&='\\'
+  end if
 end if
 
 constant df1 = path & "Dwarf Fortress.exe"
 sequence strings = extract_strings_map(fn, xref_map)
 if debug then
     printf(1,"%d strings extracted.\n", length(strings))
-    if length(cmd)>=4 then
-        integer lo=second(value(cmd[3])), hi=second(value(cmd[4]))
+    if length(cmd)>=5 then
+        integer lo=second(value(cmd[4])), hi=second(value(cmd[5]))
         if lo <= 0 or lo > length(strings) then
             lo = 1
             printf(1,"Lower bound is too low or too high. Set to 1.\n",lo)

extract_strings.e

 end function
 
 function allowed(integer i)
-    return i='\r' or (i>=' ' and i<127 and not forbidden(i))
+    return i='\r' or i='\t' or (i>=' ' and i<127 and not forbidden(i))
 end function
 
 function letter(integer i)