qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/2] hxtool: Add syntax error detection
Date: Sat, 22 May 2010 09:27:12 +0000	[thread overview]
Message-ID: <AANLkTimhqKHmziAukmDnPZ-tiyp_0XlheRDNxDYiOMlu@mail.gmail.com> (raw)
In-Reply-To: <4BF4E1D1.1010507@web.de>

Thanks, applied.

On Thu, May 20, 2010 at 7:16 AM, Jan Kiszka <jan.kiszka@web.de> wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Add basic imbalance detection for STEXT/ETEXI.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  hxtool |   16 +++++++++++++++-
>  1 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/hxtool b/hxtool
> index 0fdbc64..8f65532 100644
> --- a/hxtool
> +++ b/hxtool
> @@ -19,11 +19,24 @@ hxtoh()
>  hxtotexi()
>  {
>     flag=0
> +    line=1
>     while read -r str; do
>         case "$str" in
>             HXCOMM*)
>             ;;
> -            STEXI*|ETEXI*) flag=$(($flag^1))
> +            STEXI*)
> +            if test $flag -eq 1 ; then
> +                echo "line $line: syntax error: expected ETEXI, found $str" >&2
> +                exit 1
> +            fi
> +            flag=1
> +            ;;
> +            ETEXI*)
> +            if test $flag -ne 1 ; then
> +                echo "line $line: syntax error: expected STEXI, found $str" >&2
> +                exit 1
> +            fi
> +            flag=0
>             ;;
>             DEFHEADING*)
>             echo "$(expr "$str" : "DEFHEADING(\(.*\))")"
> @@ -32,6 +45,7 @@ hxtotexi()
>             test $flag -eq 1 && echo "$str"
>             ;;
>         esac
> +        line=$((line+1))
>     done
>  }
>
> --
> 1.6.0.2
>
>

      reply	other threads:[~2010-05-22  9:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4BF4E1A9.9010405@web.de>
2010-05-20  7:16 ` [Qemu-devel] [PATCH 2/2] hxtool: Add syntax error detection Jan Kiszka
2010-05-22  9:27   ` Blue Swirl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimhqKHmziAukmDnPZ-tiyp_0XlheRDNxDYiOMlu@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).