From 01fb3d86ee588be30c5ee8ef6b89f041a58e358c Mon Sep 17 00:00:00 2001 From: jozan Date: Tue, 10 Nov 2020 17:41:33 +0000 Subject: In progress FossilOrigin-Name: 32bab09dcbb5f5f7ce85daeed0fa1c030acd73a9a643c35506322cc3fd1a6a33 --- src/c_subst.c | 37 +++++++++++++++++++++++++++++++++++-- src/c_subst.h | 2 +- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/c_subst.c b/src/c_subst.c index 2423609..406d0ae 100644 --- a/src/c_subst.c +++ b/src/c_subst.c @@ -179,6 +179,39 @@ c_num_prefix_subst(char filename[]) } } +static void +c_specific_subst(char filename[]) +{ + char *p; + + p = filename; + while (*p != 0x00) { + if ((*p == 'c' || *p == 'C')) { + if (*(p + 1) == '+' && *(p + 2) == '+') { + *(p) = 'c'; + *(p + 1) = 'x'; + *(p + 2) = 'x'; + } + } + p++; + } +} + +static void +c_unicode_subst(char filename[]) +{ + unsigned char *p; + + p = (unsigned char*)filename; + while (*p != 0x00) { + if (u_ischarset(*p, "")) { + *p = 'c'; + c_unicode_subst(filename); + } + p++; + } +} + static void c_subst_current (char new_fname[], @@ -196,8 +229,8 @@ c_subst_current } c_ext_subst(new_fname, cxx); c_num_prefix_subst(new_fname); - /* c_exascii_subst(new_fname, hyphen); */ - /* c_unicode_subst(new_fname, hyphen); */ + c_specific_subst(new_fname); + c_unicode_subst(new_fname); c_classic_subst(new_fname, hyphen); } diff --git a/src/c_subst.h b/src/c_subst.h index 3ca4d65..11e50d6 100644 --- a/src/c_subst.h +++ b/src/c_subst.h @@ -50,7 +50,7 @@ #include "c_unixize.h" -#define C_CHARSET_VALID "_." +#define C_CHARSET_VALID "_-." struct lfiles_s* c_subst_filenames(struct lfiles_s*, const bool_t, const unsigned char); -- cgit v1.2.3