summaryrefslogtreecommitdiff
path: root/lib/kernel/overlay_ini.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/overlay_ini.ml')
-rw-r--r--lib/kernel/overlay_ini.ml13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/kernel/overlay_ini.ml b/lib/kernel/overlay_ini.ml
index 6b6249f..09f6d52 100644
--- a/lib/kernel/overlay_ini.ml
+++ b/lib/kernel/overlay_ini.ml
@@ -37,7 +37,18 @@ let parse_sections text =
end
else
match String.index_opt line '=' with
- | None -> err "line %d: %S is neither a [section] nor a key = value line" n line
+ | None ->
+ (* Echo at most a little of the line. Pointing at line N is
+ what locates the problem; reproducing the whole line adds
+ nothing and, when someone has pointed a --lang or --overlay
+ flag at a file that is not a calendar at all, quietly
+ copies that file's contents into stderr and any log
+ collecting it. *)
+ let shown =
+ if String.length line > 40 then String.sub line 0 37 ^ "..."
+ else line
+ in
+ err "line %d: %S is neither a [section] nor a key = value line" n shown
| Some i ->
if !cur = None then
err "line %d: %S appears before any [section] header" n line