aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjozan <jozan@noemail.net>2020-11-10 17:41:33 +0000
committerjozan <jozan@noemail.net>2020-11-10 17:41:33 +0000
commit01fb3d86ee588be30c5ee8ef6b89f041a58e358c (patch)
treedc0dda45166414bf668296c20d03c37482f6915e
parentMore subst to do (diff)
downloadunixize-01fb3d86ee588be30c5ee8ef6b89f041a58e358c.tar.gz
unixize-01fb3d86ee588be30c5ee8ef6b89f041a58e358c.tar.bz2
unixize-01fb3d86ee588be30c5ee8ef6b89f041a58e358c.tar.xz
unixize-01fb3d86ee588be30c5ee8ef6b89f041a58e358c.tar.zst
unixize-01fb3d86ee588be30c5ee8ef6b89f041a58e358c.zip
In progress
FossilOrigin-Name: 32bab09dcbb5f5f7ce85daeed0fa1c030acd73a9a643c35506322cc3fd1a6a33
-rw-r--r--src/c_subst.c37
-rw-r--r--src/c_subst.h2
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);