Adding dirs with trailing slashes
A bug prevented users to add conf dirs with trailing slashes.master
parent
566cdf5df4
commit
84dc120ee8
|
@ -540,7 +540,17 @@ if args.command == "add":
|
|||
if args.confname:
|
||||
confname = args.confname
|
||||
else:
|
||||
confname = os.path.basename(args.conf)
|
||||
confname = args.conf
|
||||
|
||||
# We need to remove trailing '/' because 'os.path.basename("toto/")'
|
||||
# returns ''. And that's not cool.
|
||||
while confname[-1] == "/":
|
||||
confname = confname[:-1] # Remove trailing slashes
|
||||
|
||||
confname = os.path.basename(confname)
|
||||
|
||||
# Remove leading dots, so the name under which the conffile is saved is
|
||||
# not hidden.
|
||||
while confname[0] == ".":
|
||||
confname = confname[1:] # Remove leading dots
|
||||
|
||||
|
|
Loading…
Reference in New Issue