From f2a5efc0cebf2e14e9038b7ee8baefd8f83e0b90 Mon Sep 17 00:00:00 2001 From: jozan Date: Sun, 8 Nov 2020 21:15:49 +0000 Subject: More subst to do FossilOrigin-Name: a4e2a4c3655a95845d8b85510a918bbf7e1b1277387f0b3a41f8d7d98708a7fc --- src/c_subst.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/c_subst.c b/src/c_subst.c index 3fce51f..2423609 100644 --- a/src/c_subst.c +++ b/src/c_subst.c @@ -130,7 +130,11 @@ c_classic_subst c_classic_subst(filename, hyphen); } if (*p == sep && *(p + 1) == sep) { - memmove(p, p + 1, strlen(p + 1) * sizeof(char)); + memmove(p, p + 1, (strlen(p + 1) + 1) * sizeof(char)); + c_classic_subst(filename, hyphen); + } + if (*p == '.' && *(p + 1) == '.') { + memmove(p, p + 1, (strlen(p + 1) + 1) * sizeof(char)); c_classic_subst(filename, hyphen); } if (*p == ' ') { @@ -140,7 +144,9 @@ c_classic_subst if ( isalnum(*p) == 0 && u_ischarset(*p, C_CHARSET_VALID) == FALSE - ) { + ) { + memmove(p, p + 1, (strlen(p + 1) + 1) * sizeof(char)); + c_classic_subst(filename, hyphen); } p++; } @@ -160,7 +166,7 @@ c_num_prefix_subst(char filename[]) } else { p_probe = p + 1; - while (*p_probe != 0x00 && *p_probe == '.') { + while (*p_probe != 0x00 && *p_probe != '.') { p_probe++; } if (*p_probe != 0x00) { -- cgit v1.2.3