conffile can be a pipe

This commit is contained in:
Radovan Garabík 2016-12-14 14:53:36 +01:00
parent 79f8c178d0
commit 82ca58087c
2 changed files with 4 additions and 2 deletions

3
grc
View File

@ -93,7 +93,8 @@ if cfile == "":
conffilenames += [home + '/.grc/grc.conf']
conffilenames += ['/usr/local/etc/grc.conf', '/etc/grc.conf']
for i in conffilenames:
if os.path.isfile(i):
# test if conffile exists, it can be also a pipe
if os.path.exists(i) and not os.path.isdir(i):
conffile = i
break
regexplist = []

3
grcat
View File

@ -106,7 +106,8 @@ if len(sys.argv) != 2:
conffile_arg = sys.argv[1] # tentative conffile
for i in conffilepath:
if os.path.isfile(i+conffile_arg):
# test if conffile exists, it can be also a pipe
if os.path.exists(i+conffile_arg) and not os.path.isdir(i+conffile_arg):
conffile = i+conffile_arg
break