From 95705e381b2256df902ae36f64167b882dba7548 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Thu, 25 Aug 2022 19:38:00 +0300 Subject: tree: move printing error into check_sneaky_paths() Avoid repeating the same error messages. --- src/routines.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/routines.c') diff --git a/src/routines.c b/src/routines.c index 09916aa..21c569b 100644 --- a/src/routines.c +++ b/src/routines.c @@ -33,6 +33,7 @@ #if defined(DISPLAY) #include "r-x11.h" #endif +#include "output.h" #define NUMBER_ALLOWED_CHARS (10+26+26+8) @@ -72,8 +73,10 @@ int check_sneaky_paths(const char *path) int length = strlen(path), i; for(i = 1; i < length; i++) { - if(path[i-1] == '.' && path[i] == '.') + if(path[i-1] == '.' && path[i] == '.') { + print_error("Error: You have used forbidden paths\n"); return 1; + } } return 0; } -- cgit v1.2.3-18-g5258