aboutsummaryrefslogtreecommitdiffstats
path: root/src/implementation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/implementation.c')
-rw-r--r--src/implementation.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/implementation.c b/src/implementation.c
index d8b0973..e499f0a 100644
--- a/src/implementation.c
+++ b/src/implementation.c
@@ -53,18 +53,13 @@ static void copyText(char *password)
}
/* check two dot in path */
-int checkForbiddenPaths(char *path)
+int check_sneaky_paths(const char *path)
{
- int i, length;
- int firstdot = 0;
- for(i = 0, length = strlen(path); i < length; i++)
+ int length = strlen(path), i;
+ for(i = 1; i < length; i++)
{
- if(path[i] == '.') {
- if(firstdot)
- return 1;
- firstdot++;
- }
- else firstdot = 0;
+ if(path[i-1] == '.' && path[i] == '.')
+ return 1;
}
return 0;
}