summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/global.cc4
-rw-r--r--src/output.cc25
-rw-r--r--src/strptime.cc2
-rw-r--r--src/textual.cc3
4 files changed, 19 insertions, 15 deletions
diff --git a/src/global.cc b/src/global.cc
index b1c45d45..37765a9b 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -136,9 +136,7 @@ void global_scope_t::read_init()
path init_file;
if (HANDLED(init_file_)) {
init_file=HANDLER(init_file_).str();
- if (exists(init_file)) {
- parse_init(init_file);
- } else {
+ if (!exists(init_file)) {
throw_(parse_error, _f("Could not find specified init file %1%") % init_file);
}
} else {
diff --git a/src/output.cc b/src/output.cc
index c6c8ecd7..2a8c8201 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -332,18 +332,19 @@ void report_tags::flush()
void report_tags::gather_metadata(item_t& item)
{
- if (item.metadata)
- foreach (const item_t::string_map::value_type& data, *item.metadata) {
- string tag(data.first);
- if (report.HANDLED(values) && data.second.first)
- tag += ": " + data.second.first.get().to_string();
-
- std::map<string, std::size_t>::iterator i = tags.find(tag);
- if (i == tags.end())
- tags.insert(tags_pair(tag, 1));
- else
- (*i).second++;
- }
+ if (! item.metadata)
+ return;
+ foreach (const item_t::string_map::value_type& data, *item.metadata) {
+ string tag(data.first);
+ if (report.HANDLED(values) && data.second.first)
+ tag += ": " + data.second.first.get().to_string();
+
+ std::map<string, std::size_t>::iterator i = tags.find(tag);
+ if (i == tags.end())
+ tags.insert(tags_pair(tag, 1));
+ else
+ (*i).second++;
+ }
}
void report_tags::operator()(post_t& post)
diff --git a/src/strptime.cc b/src/strptime.cc
index 6f670baf..069b9267 100644
--- a/src/strptime.cc
+++ b/src/strptime.cc
@@ -21,6 +21,7 @@
#include <ctype.h>
#include <string.h>
+#if defined(__CYGWIN__)
// Define strnicmp for Cygwin.
#ifndef strcmpi
#define strcmpi strcasecmp
@@ -34,6 +35,7 @@
#ifndef strnicmp
#define strnicmp strncasecmp
#endif
+#endif
static const char* kWeekFull[] = {
"Sunday", "Monday", "Tuesday", "Wednesday",
diff --git a/src/textual.cc b/src/textual.cc
index dcb69858..7ad98809 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -563,6 +563,9 @@ void instance_t::automated_xact_directive(char * line)
expr_t::ptr_op_t expr =
query.parse_args(string_value(skip_ws(line + 1)).to_sequence(),
keeper, false, true);
+ if (!expr) {
+ throw parse_error(_("Expected predicate after '='"));
+ }
unique_ptr<auto_xact_t> ae(new auto_xact_t(predicate_t(expr, keeper)));
ae->pos = position_t();