summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/context.h2
-rw-r--r--src/error.cc2
-rw-r--r--src/item.cc1
-rw-r--r--src/report.cc15
-rw-r--r--src/session.cc1
5 files changed, 14 insertions, 7 deletions
diff --git a/src/context.h b/src/context.h
index 7373be39..9fe0613b 100644
--- a/src/context.h
+++ b/src/context.h
@@ -121,7 +121,7 @@ inline parse_context_t open_for_reading(const path& pathname,
throw_(std::runtime_error,
_f("Cannot read journal file %1%") % filename);
- path parent(pathname.parent_path());
+ path parent(filename.parent_path());
shared_ptr<std::istream> stream(new ifstream(filename));
parse_context_t context(stream, parent);
context.pathname = filename;
diff --git a/src/error.cc b/src/error.cc
index 58339db7..d7e92daa 100644
--- a/src/error.cc
+++ b/src/error.cc
@@ -84,7 +84,7 @@ string source_context(const path& file,
const string& prefix)
{
const std::streamoff len = end_pos - pos;
- if (! len || file == path("/dev/stdin"))
+ if (! len || file == path("/dev/stdin") || file.empty())
return _("<no source context>");
assert(len > 0);
diff --git a/src/item.cc b/src/item.cc
index 24d03ba1..362fac7f 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -476,7 +476,6 @@ expr_t::ptr_op_t item_t::lookup(const symbol_t::kind_t kind,
else if (name == "filepath")
return WRAP_FUNCTOR(get_wrapper<&get_filepath>);
break;
- break;
case 'h':
if (name == "has_tag")
diff --git a/src/report.cc b/src/report.cc
index 08365a6b..d4beaf2a 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -1089,6 +1089,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT(anon);
else OPT_ALT(color, ansi);
else OPT(auto_match);
+ else OPT(aux_date);
else OPT(average);
else OPT(account_width_);
else OPT(amount_width_);
@@ -1096,7 +1097,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
case 'b':
OPT(balance_format_);
else OPT(base);
- else OPT_ALT(basis, cost);
+ else OPT(basis);
else OPT_(begin_);
else OPT(bold_if_);
else OPT(budget);
@@ -1105,6 +1106,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
break;
case 'c':
OPT(csv_format_);
+ else OPT_ALT(gain, change);
else OPT(cleared);
else OPT(collapse);
else OPT(collapse_if_zero);
@@ -1122,6 +1124,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT(dc);
else OPT(depth_);
else OPT(deviation);
+ else OPT_ALT(rich_data, detail);
else OPT_(display_);
else OPT(display_amount_);
else OPT(display_total_);
@@ -1146,7 +1149,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT_ALT(head_, first_);
break;
case 'g':
- OPT_ALT(gain, change);
+ OPT(gain);
else OPT(group_by_);
else OPT(group_title_format_);
else OPT(generated);
@@ -1173,7 +1176,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT_ALT(tail_, last_);
break;
case 'm':
- OPT_ALT(market, value);
+ OPT(market);
else OPT(monthly);
else OPT(meta_);
else OPT(meta_width_);
@@ -1203,6 +1206,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT(price);
else OPT(prices_format_);
else OPT(pricedb_format_);
+ else OPT(primary_date);
else OPT(payee_width_);
else OPT(prepend_format_);
else OPT(prepend_width_);
@@ -1220,7 +1224,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT(revalued);
else OPT(revalued_only);
else OPT(revalued_total_);
- else OPT_ALT(rich_data, detail);
+ else OPT(rich_data);
break;
case 's':
OPT(sort_);
@@ -1247,6 +1251,9 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT(unrealized_losses_);
else OPT(unround);
break;
+ case 'v':
+ OPT_ALT(market, value);
+ break;
case 'w':
OPT(weekly);
else OPT_(wide);
diff --git a/src/session.cc b/src/session.cc
index b6153203..a8bb628a 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -159,6 +159,7 @@ std::size_t session_t::read_data(const string& master_account)
shared_ptr<std::istream> stream(new std::istringstream(buffer.str()));
parsing_context.push(stream);
+ parsing_context.get_current().pathname = "/dev/stdin";
} else {
parsing_context.push(pathname);
}