Skip to content

Commit

Permalink
Fix parsing empty hostname fields in pgpass.
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitri committed Aug 14, 2018
1 parent 34cc253 commit 1ee389d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parsers/parse-pgpass.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
(pgpass-char-p character))))
(:lambda (e) (text e)))

(defrule pgpass-line (and pgpass-entry #\: pgpass-entry #\:
(defrule pgpass-line (and (? pgpass-entry) #\: pgpass-entry #\:
pgpass-entry #\: pgpass-entry #\:
(? pgpass-entry))
(:lambda (pl)
(make-pgpass :hostname (first pl)
(make-pgpass :hostname (or (first pl) "localhost")
:port (third pl)
:database (fifth pl)
:username (seventh pl)
Expand Down

0 comments on commit 1ee389d

Please sign in to comment.