diff options
Diffstat (limited to 'packaging/var-checker')
-rwxr-xr-x | packaging/var-checker | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packaging/var-checker b/packaging/var-checker index fe7491df..f17c69a2 100755 --- a/packaging/var-checker +++ b/packaging/var-checker @@ -4,7 +4,7 @@ # for vars that are defined but not used, and for inconsistent array # sizes. Run it from inside the main rsync directory. -import re, argparse, glob +import os, sys, re, argparse, glob VARS_RE = re.compile(r'^(?!(?:extern|enum)\s)([a-zA-Z]\S*\s+.*);', re.M) EXTERNS_RE = re.compile(r'^extern\s+(.*);', re.M) @@ -15,8 +15,15 @@ def main(): add_syscall_c = set('t_stub.c t_unsafe.c tls.c trimslash.c'.split()) add_util_c = set('t_stub.c t_unsafe.c'.split()) + if not os.path.exists('syscall.c'): + if os.path.exists('var-checker'): + os.chdir('..') + else: + print("Couldn't find the source dir.") + sys.exit(1) + syscall_c = slurp_file('syscall.c', True) - util_c = slurp_file('util.c', True) + util_c = slurp_file('util1.c', True) for fn in sorted(glob.glob('*.c')): txt = slurp_file(fn) |