diff options
author | jozan <jozan@noemail.net> | 2020-11-11 20:17:32 +0000 |
---|---|---|
committer | jozan <jozan@noemail.net> | 2020-11-11 20:17:32 +0000 |
commit | cb0b8461d5e4a239116a3246beff73ac7f7563d8 (patch) | |
tree | 3bdaee57b85b309056291341365b9cde1f937bc6 | |
parent | In progress (diff) | |
download | unixize-cb0b8461d5e4a239116a3246beff73ac7f7563d8.tar.gz unixize-cb0b8461d5e4a239116a3246beff73ac7f7563d8.tar.bz2 unixize-cb0b8461d5e4a239116a3246beff73ac7f7563d8.tar.xz unixize-cb0b8461d5e4a239116a3246beff73ac7f7563d8.tar.zst unixize-cb0b8461d5e4a239116a3246beff73ac7f7563d8.zip |
In progress
FossilOrigin-Name: b805f8e1d50c1dc8dbdc693464f08f0c957302aee4cdb779ed68d34cd8abb815
-rw-r--r-- | .fossil-settings/ignore-glob | 1 | ||||
-rw-r--r-- | src/c_subst.c | 34 | ||||
-rw-r--r-- | src/u_utils.c | 2 | ||||
-rw-r--r-- | src/u_utils.h | 2 |
4 files changed, 22 insertions, 17 deletions
diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob index 14b1716..df8b23b 100644 --- a/.fossil-settings/ignore-glob +++ b/.fossil-settings/ignore-glob @@ -3,3 +3,4 @@ unixize git compile_flags.txt test +test2 diff --git a/src/c_subst.c b/src/c_subst.c index b589552..4b410ab 100644 --- a/src/c_subst.c +++ b/src/c_subst.c @@ -204,21 +204,25 @@ c_unicode_subst(char filename[]) p = filename; while (*p != 0x00) { - 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); + if (*p == -61) { + if ( + u_ischarset(*p, C_CHARSET_A_MAJ) == TRUE || + u_ischarset(*p, C_CHARSET_A_MIN) == TRUE + ) { + printf(">>>>{%hhd}\n", *p); + printf(">>>>{%hhd}\n", *(p + 1)); + *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++; } diff --git a/src/u_utils.c b/src/u_utils.c index 50f21f2..c5dc869 100644 --- a/src/u_utils.c +++ b/src/u_utils.c @@ -237,7 +237,7 @@ u_decrease_subpath(char subp[]) bool_t u_ischarset -(wchar_t c, +(int c, const char cs[]) { char *p; diff --git a/src/u_utils.h b/src/u_utils.h index 058ef7a..1add802 100644 --- a/src/u_utils.h +++ b/src/u_utils.h @@ -54,4 +54,4 @@ void u_del_nargv(char** nargv); char** u_get_nargv(struct opts_s*); void u_increase_subpath(char[], const char[]); void u_decrease_subpath(char[]); -bool_t u_ischarset(wchar_t, const char[]); +bool_t u_ischarset(int, const char[]); |