about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-10-20 15:53:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-10-20 15:53:03 -0700
commit523db004d9d351c8f1d79ce655ce97b819934393 (patch)
tree38ae85651efaaad112bed1b33d634999d7bd4d4e
parentf61976c61a29a82feaec740ba09bbec51ce55ba9 (diff)
downloadlines.love-523db004d9d351c8f1d79ce655ce97b819934393.tar.gz
change section delimiters in log for OpenBSD
Thanks eril for the report and patch.
-rw-r--r--log.lua8
-rw-r--r--log_browser.lua8
2 files changed, 10 insertions, 6 deletions
diff --git a/log.lua b/log.lua
index 6bbd0c4..8903e08 100644
--- a/log.lua
+++ b/log.lua
@@ -14,13 +14,17 @@ function log_start(name, stack_frame_index)
 	if stack_frame_index == nil then
 		stack_frame_index = 3
 	end
-	log(stack_frame_index, '\u{250c} ' .. name)
+	-- I'd like to use the unicode character \u{250c} here, but it doesn't work
+	-- in OpenBSD.
+	log(stack_frame_index, '[ u250c ' .. name)
 end
 function log_end(name, stack_frame_index)
 	if stack_frame_index == nil then
 		stack_frame_index = 3
 	end
-	log(stack_frame_index, '\u{2518} ' .. name)
+	-- I'd like to use the unicode character \u{2518} here, but it doesn't work
+	-- in OpenBSD.
+	log(stack_frame_index, '] u2518 ' .. name)
 end
 
 function log_new(name, stack_frame_index)
diff --git a/log_browser.lua b/log_browser.lua
index 6432d85..6b71da6 100644
--- a/log_browser.lua
+++ b/log_browser.lua
@@ -42,15 +42,15 @@ function log_browser.parse(State)
           line.data = data
         end
         line.section_stack = table.shallowcopy(Section_stack)
-      elseif line.data:match('\u{250c}') then
+      elseif line.data:match('%[ u250c') then
         line.section_stack = table.shallowcopy(Section_stack)  -- as it is at the beginning
-        local section_name = line.data:match('\u{250c}%s*(.*)')
+        local section_name = line.data:match('u250c%s*(.*)')
         table.insert(Section_stack, {name=section_name})
         line.section_begin = true
         line.section_name = section_name
         line.data = nil
-      elseif line.data:match('\u{2518}') then
-        local section_name = line.data:match('\u{2518}%s*(.*)')
+      elseif line.data:match('%] u2518') then
+        local section_name = line.data:match('] u2518%s*(.*)')
         if array.find(Section_stack, function(x) return x.name == section_name end) then
           while table.remove(Section_stack).name ~= section_name do
             --