Menu

#11 Problem detecting quoted values in config files

2.0
closed-invalid
nobody
None
5
2005-10-08
2005-07-31
Bodo Eggert
No

[pid 22511] send(4, "<63>Jul 31 16:32:43 leafnode[22511]: regexp
filter: detail: \"From: Bodo Eggert <7eggert@7eggert.dyndns.org>\r\"
=~ /^From: *[0-9]*/ matched", 137, 0) = 137

$ grep -F '[0-9]' /etc/leafnode/filters
pattern = ^From: *"[0-9]*" <[0-9]*>
$

AAAAAAAAARRRRRGH!!!

--- configutil.c~ 2005-07-31 16:56:07.000000000 +0200
+++ configutil.c 2005-07-31 16:56:07.000000000 +0200
@@ -112,11 +112,11 @@ parse_line(/*@unique@*/ char *l, /*@out@
}

/* read value */
+ if (*p == '"') { mode = quoted; p++; }
for (le = 0 ; le < TOKENSIZE - 1 ; le ++) {
char c = *p++;
if (mode == plain) {
if (c == '#' || c == '\0') { break; }
- if (c == '"') { mode = quoted; continue; }
*value++ = c;
} else if (mode == quoted) {
if (c == '\\') {

Discussion

  • Bodo Eggert

    Bodo Eggert - 2005-07-31
    • milestone: --> 2.0
     
  • Matthias Andree

    Matthias Andree - 2005-09-07
    • status: open --> pending-invalid
     
  • Matthias Andree

    Matthias Andree - 2005-09-07

    Logged In: YES
    user_id=2788

    The filterfile understands quoting, so you can use:

    pattern = "^From: *\"[0-9]*\" <[0-9]*>"

    Why would I want to require that the quote be the very first
    character?

     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 30 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-invalid --> closed-invalid
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.