Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 5 Dec 2018 20:07:04 +0100
From: Solar Designer <solar@...nwall.com>
To: john-users@...ts.openwall.com
Subject: Re: Quotation character in preprocessor

On Wed, Dec 05, 2018 at 06:49:00PM +0000, oayz wrote:
>   I need a rule with quotation mark. This rule works fine:
> : $[."]
> This obviously doesn't (quote inside quotes):
> : Az"[."]"

You can change this line to e.g.:

Az,[."],

which the preprocessor expands under-the-hood into two rules:

Az,.,
Az,",

Of course, there's no reason to use the "A" command for just one
character, but I assume you gave this as an example, and your actual use
is with longer strings.

> So I tried usual "escape" character, still getting "invalid rule":
> : Az"[.\"]"
> I think it should work - a bug?

No, and no.  The quote character is just a character you provide to the
"A" command telling it that you'll terminate the string with that
character.  It is not special to the preprocessor, so no reason to
escape it for the preprocessor.  In your case, the line expanded to:

Az"."
Az"""

where the second expanded rule is invalid: it appends an empty string
and is followed by an extra quote character in place where the parser
expects a command character.  Luckily, there's no command of that name,
so you get an error reported.

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.