> >On Mon, May 22, 2006 at 03:07:14PM -0600, Theo de Raadt wrote:
> >>>># pas on re0 from any \           #
> >>>>#                  to any port 59    #
> >[...]
> >>>  i would think the good reason is that the line is not a comment
> >>>  as you imagine, but would effectively turn into:
> >[...]
> >>\<ret> is the only special case that says "ignore both".  In any other
> >>case \<c> should translate into just the character <c>.

  just occurred to me that maybe i also misunderstood what the OP wanted.

  these two seem different:

---
rule with valid \<ret><whitespace><whitespace># here is a comment
      syntax for pf # here is another comment
---

  as opposed to:

---
rule with valid \<ret><whitespace><whitespace>
      syntax for pf
---

  eg, maybe the OP was using octothorpes as an ascii box-drawing
  char and did not mean to imply that the 'pass on' and 'port 59' lines
  both had trailing octothorpes in them in his pf.conf?

  ( my response was to the first of the two, tho that doesn't mean
    i'm any less wrong )

> Matthias Kilian wrote:
> >It's common that anything after an unquoted # up to the newline
> >including backslashed text is ignored, at least in sh(1), awk(1)
> >and friends.

  eg ( sed -nel somefile ), :

-( sed -nel somefile )-
pass on \\\r#test\n$
lo all keep state\n$
-----------------------

  would turn into:

----
pass on lo all keep state
----

  by virtue of the unquoted # up to the newline being ignored,
  essentially making:

---
pass on \\\r\n$
lo all keep state\n$
---

  be the two components that the parser should have to concatenate?
  ( i made the '\r' with ^V^M )

On Tue, May 23, 2006 at 12:08:52AM +0200, Alexander Hall wrote:
> I agree. Even the sample pf.conf says...
> 
>   #rdr pass on $ext_if proto tcp from <spamd> to port smtp \
>   #   -> 127.0.0.1 port spamd
> 
> ...when it actually _could_ use...
> 
>   #rdr pass on $ext_if proto tcp from <spamd> to port smtp \
>       -> 127.0.0.1 port spamd

  that one i think is slightly different than the OP.  if
  it ignored text from the first '#' up to the newline, that
  one would error out too, right ( the '\' meant to escape the
  newline would itself be ignored )?
  
  the:

----
# stuff i \
  commented out
----  

  syntax seems intuitive to me, but given that i haven't
  written any lexer, i don't have any standing.

-- 

  jared

[ openbsd 3.9-current GENERIC ( may  1 ) // i386 ]

Reply via email to