summaryrefslogtreecommitdiff
path: root/src/session.h
diff options
context:
space:
mode:
authorJohannes Loher <johannes.loher@fg4f.de>2017-12-29 16:44:24 +0100
committerJohannes Loher <johannes.loher@fg4f.de>2017-12-29 16:44:24 +0100
commit9409f25d0de638097a806f1f75b75473be192b82 (patch)
tree120735640c78bd7de1785bc9f09a2f368c5abc10 /src/session.h
parent3364850cc7cf73fc67af1ea6cd9a65a32e336623 (diff)
downloadfork-ledger-9409f25d0de638097a806f1f75b75473be192b82.tar.gz
fork-ledger-9409f25d0de638097a806f1f75b75473be192b82.tar.bz2
fork-ledger-9409f25d0de638097a806f1f75b75473be192b82.zip
don't add paths to files, if there is already a path that points to the same file
Diffstat (limited to 'src/session.h')
-rw-r--r--src/session.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/session.h b/src/session.h
index 82d9981f..7e299959 100644
--- a/src/session.h
+++ b/src/session.h
@@ -52,6 +52,16 @@ namespace ledger {
class xact_t;
+struct ComparePaths
+{
+ bool operator()(const path& p1, const path& p2) const
+ {
+ return p1 < p2 && !boost::filesystem::equivalent(p1, p2);
+ }
+};
+
+#define COMMA ,
+
class session_t : public symbol_scope_t
{
friend void set_session_context(session_t * session);
@@ -143,7 +153,7 @@ public:
OPTION__
(session_t, file_, // -f
- std::set<path> data_files;
+ std::set<path COMMA ComparePaths> data_files;
CTOR(session_t, file_) {}
DO_(str) {
if (parent->flush_on_next_data_file) {