From a3096d054970b363b8100e6fa1ceeb5051758fcd Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 14 Aug 2022 08:48:50 +0100 Subject: [PATCH] dev: journalFilePath, include: show (unknown) instead of nothing Probably not user-visible, but might improve debug logging slightly. --- hledger-lib/Hledger/Data/Journal.hs | 2 +- hledger-lib/Hledger/Read/JournalReader.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index 0bf62ad86..a77a071bf 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -308,7 +308,7 @@ journalFilePaths :: Journal -> [FilePath] journalFilePaths = map fst . jfiles mainfile :: Journal -> (FilePath, Text) -mainfile = headDef ("", "") . jfiles +mainfile = headDef ("(unknown)", "") . jfiles addTransaction :: Transaction -> Journal -> Journal addTransaction t j = j { jtxns = t : jtxns j } diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index 591154752..290111e41 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -328,7 +328,7 @@ includedirectivep = do where childfilename = takeFileName filepath - parentfilename = maybe "" takeFileName $ headMay $ jincludefilestack parentj -- more accurate than journalFilePath parentj somehow + parentfilename = maybe "(unknown)" takeFileName $ headMay $ jincludefilestack parentj -- XXX more accurate than journalFilePath for some reason -- Update the parse state. put parentj'