diff options
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | src/c_subst.c | 13 | ||||
-rw-r--r-- | src/c_unixize.c | 2 |
3 files changed, 15 insertions, 3 deletions
@@ -52,6 +52,9 @@ ${OBJS_DIR}%.c.o: ${SRCS_DIR}%.c ${INCS} Makefile ${TARGET}: ${OBJS} ${CC} ${CFLAGS} -o ${TARGET} ${OBJS} +opti: CFLAGS += -march=ivybridge -O2 -pipe +opti: all + all: ${TARGET} debug: CFLAGS += -g3 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); diff --git a/src/c_unixize.c b/src/c_unixize.c index 91188c9..dfc166d 100644 --- a/src/c_unixize.c +++ b/src/c_unixize.c @@ -133,7 +133,7 @@ main og_files->filename, new_files->filename, strlen(new_files->filename) + 1 - ) != 0 && + ) != 0 || new_files->filename[0] != 0x00 ) { if (opts.verbose == TRUE) { |