emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#20095: closed (conditional branching)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#20095: closed (conditional branching)
Date: Sun, 10 May 2015 17:17:02 +0000

Your message dated Sun, 10 May 2015 10:16:05 -0700
with message-id <address@hidden>
and subject line Re: sed conditional branching
has caused the debbugs.gnu.org bug report #20095,
regarding conditional branching
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
20095: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20095
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: conditional branching Date: Thu, 12 Mar 2015 02:42:07 +0000 (UTC)
I'm using sed to verify that a log file is in the correct format, to make it impossible for crafted input to cause any problems in a shell script.

I'm stumped, and the only explanation that I can think of for why my script isn't working is that sed's "t" command is not working properly.

If I comment out any 2 of the 3 main commands, the output is as expected:
  • white space stripper always "succeeds", and thus the script jumps to the success section
  • curly brace detector jumps to the "success" section if triggered.  otherwise, the t command fails, because there wasn't a substitution in the first place
  • entry converter succeeds if format of entry is valid, assuming that there isn't any surrounding white space
However, if I un-comment all 3 of the main commands, the script doesn't fail when input is invalid.  Instead, it spits out the un-transformed invalid input, as if it was valid.

Am I missing something, or is this a bug?

Attachment: filesystem-events.log
Description: Text Data

Attachment: log-filter.sed
Description: Text document


--- End Message ---
--- Begin Message --- Subject: Re: sed conditional branching Date: Sun, 10 May 2015 10:16:05 -0700
tags 20095 notabug
thanks

Davide Brini's analysis at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20095#8
is correct. "t" works like this:

't LABEL'
     Branch to LABEL only if there has been a successful 's'ubstitution
     since the last input line was read or conditional branch was taken.
     The LABEL may be omitted, in which case the next cycle is started.

yet your script expects it to work differently.

Hence, I'm marking this issue as a non-bug and closing it.
However, you are welcome to reply here; any comments will
be logged at https://bugs.gnu.org/20095.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]