diff --git a/sysctl.c b/sysctl.c index 5432b773..b7d89a3b 100644 --- a/sysctl.c +++ b/sysctl.c @@ -63,11 +63,16 @@ static char *pattern; static int pattern_match(const char *string, const char *pattern); static void slashdot(char *restrict p, char old, char new){ + int warned = 1; p = strpbrk(p,"/."); if(!p) return; /* nothing -- can't be, but oh well */ if(*p==new) return; /* already in desired format */ while(p){ char c = *p; + if((*(p+1) == '/' || *(p+1) == '.') && warned) { + warnx(_("separators should not be repeated: %s"), p); + warned = 0; + } if(c==old) *p=new; if(c==new) *p=old; p = strpbrk(p+1,"/.");