diff options
-rw-r--r-- | src/c_subst.c | 37 | ||||
-rw-r--r-- | 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 @@ -180,6 +180,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[], const char og_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); |