aboutsummaryrefslogtreecommitdiffstats
path: root/src/c_subst.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/c_subst.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/c_subst.c b/src/c_subst.c
index de09514..ace57d3 100644
--- a/src/c_subst.c
+++ b/src/c_subst.c
@@ -65,9 +65,10 @@ c_ext_subst
(char filename[],
const unsigned char cxx)
{
- const size_t len = strlen(filename);
+ size_t len;
- if (cxx == 0 || len < 4) {
+ len = strlen(filename);
+ if (cxx == 0 || len < 5) {
return;
}
if (
@@ -134,6 +135,10 @@ c_classic_subst
memmove(p, p + 1, (strlen(p + 1) + 1) * sizeof(char));
c_classic_subst(filename, hyphen, preserve);
}
+ if (*p == sep && *(p + 1) == '.') {
+ memmove(p, p + 1, (strlen(p + 1) + 1) * sizeof(char));
+ c_classic_subst(filename, hyphen, preserve);
+ }
if (*p == '.' && *(p + 1) == '.') {
memmove(p, p + 1, (strlen(p + 1) + 1) * sizeof(char));
c_classic_subst(filename, hyphen, preserve);
@@ -356,7 +361,11 @@ c_subst_current
{
unsigned char* p;
+ new_fname[0] = 0x00;
strlcpy(new_fname, og_fname, MAXPATHLEN);
+ if (new_fname[0] == 0x00) {
+ return;
+ }
p = (unsigned char*)new_fname;
while (*p != 0x00) {
*p = tolower(*p);