--- ChangeLog | 2 ++ src/indent.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+)
diff --git a/ChangeLog b/ChangeLog index f5ad166..1f797ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ * Add an option (-slc/--single-line-conditionals) to allow conditionals and their inner statement to be on the same line if they're not braced. This should fix GNU bug #42357. + * Added a small patch to add size_t, wchar_t and ptrdiff_t to + user_specials automatically. 2014-04-07 Andrew Shadura <and...@shadura.me> * Don't add extra 'const' keyword to C++ programs (closes Debian bugs diff --git a/src/indent.c b/src/indent.c index 8e49264..087b3ce 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1040,6 +1040,7 @@ int main( int argc, char ** argv) { + char *tmp; char *profile_pathname = 0; BOOLEAN using_stdin = false; exit_values_ty exit_status; @@ -1065,6 +1066,21 @@ int main( } #endif + /* 'size_t', 'wchar_t' and 'ptrdiff_t' are guarenteed to be + * available in ANSI C. + * + * I'm malloc'ing this in the hopes that it will be freed + * along with the rest of the user_specials array in + * lexi.c (assuming that it actually is.) + */ + tmp = (char *)xmalloc(25); + memcpy(tmp, "size_t", 7); + addkey(tmp, rw_decl); + memcpy(tmp + 7, "wchar_t", 8); + addkey(tmp + 7, rw_decl); + memcpy(tmp + 15, "ptrdiff_t", 10); + addkey(tmp + 15, rw_decl); + init_parser (); initialize_backups (); exit_status = total_success; -- 2.3.6 _______________________________________________ bug-indent mailing list bug-indent@gnu.org https://lists.gnu.org/mailman/listinfo/bug-indent