aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjozan <jozan@noemail.net>2020-11-12 22:35:55 +0000
committerjozan <jozan@noemail.net>2020-11-12 22:35:55 +0000
commit36894101c56dcaf6890a38f0f45a55fafc9128e3 (patch)
tree9fbacb73e016ba212d497f9ef9e948afd0617064 /src
parentNew option to show what's untouched (diff)
downloadunixize-36894101c56dcaf6890a38f0f45a55fafc9128e3.tar.gz
unixize-36894101c56dcaf6890a38f0f45a55fafc9128e3.tar.bz2
unixize-36894101c56dcaf6890a38f0f45a55fafc9128e3.tar.xz
unixize-36894101c56dcaf6890a38f0f45a55fafc9128e3.tar.zst
unixize-36894101c56dcaf6890a38f0f45a55fafc9128e3.zip
Work to do
FossilOrigin-Name: cd493106b2cdf7568781e2c69a4742da4c91e85ab0cc4403a79580b4b4cb11ac
Diffstat (limited to 'src')
-rw-r--r--src/c_subst.c13
-rw-r--r--src/c_unixize.c2
2 files changed, 12 insertions, 3 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);
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) {