public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Tim Lewis <tim.lewis@insyde.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Root Cause of Parse Failure With Redirected Input
Date: Fri, 2 Dec 2016 02:07:54 +0000	[thread overview]
Message-ID: <7236196A5DF6C040855A6D96F556A53F410BD6@msmail.insydesw.com.tw> (raw)

      if (StrStr (TempLine, L"ShellCommand,") == TempLine) {
        LoopVariable++;
      }

This line fails because, with redirected input, the file has the UCS-2 byte order mark, so the string "ShellCommand," is not at the beginning of the line. With the file, the byte order mark is not present.

Why?

     if (StreamingUnicode) {
       TempLine = ParseReturnStdInLine (FileHandle);
     } else {
       TempLine = ShellFileHandleReturnLine (FileHandle, &Ascii);
     }

The Shell library function ShellFileHandleReturnLine will strip off the byte order mark. But the ParseReturnStdInLine does not. So the first character on the line is not 'S', it is the byte order mark.

Tim


             reply	other threads:[~2016-12-02  2:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02  2:07 Tim Lewis [this message]
2017-11-06 23:09 ` Riding the UEFI shell / enabling the platform for C developers joaquin_conobolillo
2017-11-07  7:51 ` joaquin_conobolillo

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-list 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=7236196A5DF6C040855A6D96F556A53F410BD6@msmail.insydesw.com.tw \
    --to=devel@edk2.groups.io \
    /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