The format code %C is now equal to %(fmt_C)
This commit is contained in:
parent
5516a7ddb5
commit
caeb336176
2 changed files with 9 additions and 7 deletions
|
|
@ -198,17 +198,13 @@ format_t::element_t * format_t::parse_elements(const string& fmt)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default:
|
||||||
current->type = element_t::EXPR;
|
current->type = element_t::EXPR;
|
||||||
char buf[2];
|
current->chars = string(FMT_PREFIX) + *p;
|
||||||
buf[0] = *p;
|
current->expr.parse(current->chars);
|
||||||
buf[1] = '\0';
|
|
||||||
current->chars = buf;
|
|
||||||
current->expr.parse(buf);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (q != buf) {
|
if (q != buf) {
|
||||||
if (! result.get()) {
|
if (! result.get()) {
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,12 @@ public:
|
||||||
const int account_abbrev_length = -1);
|
const int account_abbrev_length = -1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define FMT_PREFIX "fmt_"
|
||||||
|
#define FMT_PREFIX_LEN 4
|
||||||
|
|
||||||
|
#define WANT_FMT() \
|
||||||
|
(std::strncmp(p, FMT_PREFIX, FMT_PREFIX_LEN) == 0)
|
||||||
|
|
||||||
} // namespace ledger
|
} // namespace ledger
|
||||||
|
|
||||||
#endif // _FORMAT_H
|
#endif // _FORMAT_H
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue