From b00e1bba7ff5ea2348887dcbcf0997a14d1d63c2 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 11 Feb 2015 11:56:52 +0100 Subject: [PATCH] Allow backslash and at-sign in user names, fix #171. When connection to MS SQL it's sometimes needed to be able to use @ or \ as part of the username, which is now possible. --- src/parsers/command-db-uri.lisp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/parsers/command-db-uri.lisp b/src/parsers/command-db-uri.lisp index bda4d1a..710e79f 100644 --- a/src/parsers/command-db-uri.lisp +++ b/src/parsers/command-db-uri.lisp @@ -25,14 +25,15 @@ (defrule doubled-at-sign (and "@@") (:constant "@")) (defrule doubled-colon (and "::") (:constant ":")) (defrule password (+ (or (not "@") doubled-at-sign)) (:text t)) -(defrule username-string (and (or #\_ (alpha-char-p character)) - (* (or (alpha-char-p character) - (digit-char-p character) - #\. - punct))) - (:text t)) - -(defrule username (and username-string (? (or doubled-at-sign doubled-colon))) +(defrule username (and (or #\_ (alpha-char-p character)) + (* (or (alpha-char-p character) + (digit-char-p character) + #\. + #\\ + punct + doubled-at-sign + doubled-colon + ))) (:text t)) (defrule dsn-user-password (and username