From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Chen, Chen A" <chen.a.chen@intel.com>,
chen881220 <ai_terran@foxmail.com>,
"Carsey, Jaben" <jaben.carsey@intel.com>
Subject: Re: [PATCH] ShellPkg: Fix a bug ">>v" cannot append data to environment variable
Date: Wed, 4 Jan 2017 17:07:49 +0000 [thread overview]
Message-ID: <CB6E33457884FA40993F35157061515C54B35BD5@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <20170104032308.476512-1-ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Please verify appropriate copyright before commit (I guess this file needs year update).
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Tuesday, January 03, 2017 7:23 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Chen, Chen A
> <chen.a.chen@intel.com>; chen881220 <ai_terran@foxmail.com>
> Subject: [edk2] [PATCH] ShellPkg: Fix a bug ">>v" cannot append data to
> environment variable
> Importance: High
>
> From: chen881220 <ai_terran@foxmail.com>
>
> When ">v" is used to redirect the command output to environment
> variable, the ending "\r\n\0" is removed before setting to environment
> variable but the length is not updated.
> It causes ">>v" fails to append data to the environment variable
> created by ">v".
> The patch fixes the above bug.
>
> Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> ---
> ShellPkg/Application/Shell/FileHandleWrappers.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c
> b/ShellPkg/Application/Shell/FileHandleWrappers.c
> index 3c11d82..67ca8e7 100644
> --- a/ShellPkg/Application/Shell/FileHandleWrappers.c
> +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c
> @@ -1074,6 +1074,10 @@ FileInterfaceEnvClose(
> (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] ==
> CHAR_CARRIAGE_RETURN)
> ) {
> ((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] = CHAR_NULL;
> + //
> + // If the NewBuffer end with \r\n\0, We will repace '\r' by '\0' and then
> update TotalSize.
> + //
> + TotalSize -= sizeof(CHAR16) * 2;
> }
>
> if (Volatile) {
> --
> 2.9.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
prev parent reply other threads:[~2017-01-04 17:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 3:23 [PATCH] ShellPkg: Fix a bug ">>v" cannot append data to environment variable Ruiyu Ni
2017-01-04 17:07 ` Carsey, Jaben [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-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=CB6E33457884FA40993F35157061515C54B35BD5@FMSMSX103.amr.corp.intel.com \
--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