The format code %C is now equal to %(fmt_C)

This commit is contained in:
John Wiegley 2009-02-15 19:53:38 -04:00
parent 5516a7ddb5
commit caeb336176
2 changed files with 9 additions and 7 deletions

View file

@ -198,16 +198,12 @@ format_t::element_t * format_t::parse_elements(const string& fmt)
break;
}
default: {
default:
current->type = element_t::EXPR;
char buf[2];
buf[0] = *p;
buf[1] = '\0';
current->chars = buf;
current->expr.parse(buf);
current->chars = string(FMT_PREFIX) + *p;
current->expr.parse(current->chars);
break;
}
}
}
if (q != buf) {

View file

@ -150,6 +150,12 @@ public:
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
#endif // _FORMAT_H