diff options
author | jozan <jozan@noemail.net> | 2020-11-10 20:20:38 +0000 |
---|---|---|
committer | jozan <jozan@noemail.net> | 2020-11-10 20:20:38 +0000 |
commit | 0518043ccfb644bc56f48f52e82f2d81ce893c14 (patch) | |
tree | b28a23ef49c024af2ebe5a68e38d1e4be6a7f31c /src/c_subst.c | |
parent | In progress (diff) | |
download | unixize-0518043ccfb644bc56f48f52e82f2d81ce893c14.tar.gz unixize-0518043ccfb644bc56f48f52e82f2d81ce893c14.tar.bz2 unixize-0518043ccfb644bc56f48f52e82f2d81ce893c14.tar.xz unixize-0518043ccfb644bc56f48f52e82f2d81ce893c14.tar.zst unixize-0518043ccfb644bc56f48f52e82f2d81ce893c14.zip |
In progress
FossilOrigin-Name: 2dc02e78538ff15abf2d4363152ab96b7222bdc88b00dc1a60c1cbb1f30cc8ae
Diffstat (limited to 'src/c_subst.c')
-rw-r--r-- | src/c_subst.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/c_subst.c b/src/c_subst.c index 406d0ae..b589552 100644 --- a/src/c_subst.c +++ b/src/c_subst.c @@ -200,12 +200,24 @@ c_specific_subst(char filename[]) static void c_unicode_subst(char filename[]) { - unsigned char *p; + char *p; - p = (unsigned char*)filename; + p = filename; while (*p != 0x00) { - if (u_ischarset(*p, "")) { - *p = 'c'; + if ( + u_ischarset(*p, C_CHARSET_A_MAJ) == TRUE || + u_ischarset(*p, C_CHARSET_A_MIN) == TRUE + ) { + *p = 'a'; + memmove(p + 1, p + 2, (strlen(p + 2) + 1) * sizeof(char)); + c_unicode_subst(filename); + } + if ( + u_ischarset(*p, C_CHARSET_O_MAJ) == TRUE || + u_ischarset(*p, C_CHARSET_O_MIN) == TRUE + ) { + *p = 'o'; + memmove(p + 1, p + 2, (strlen(p + 2) + 1) * sizeof(char)); c_unicode_subst(filename); } p++; |