public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: Tim Lewis <tim.lewis@insyde.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Carsey, Jaben" <jaben.carsey@intel.com>
Subject: Re: [shell] AliasLower never used in InternalSetAlias
Date: Fri, 28 Oct 2016 15:20:03 +0000	[thread overview]
Message-ID: <CB6E33457884FA40993F35157061515C54AB3793@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <7236196A5DF6C040855A6D96F556A53F3FD173@msmail.insydesw.com.tw>

Tim,

Given that all commands are case insensitive, I couldn't imagine why we would want case-sensitive alias.

Do we really want "Dir" to fail, while "dir" works fine?  Remember that the real command is case insensitive "ls" in either case.

-Jaben

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Tim Lewis
> Sent: Thursday, October 27, 2016 2:29 PM
> To: Tim Lewis <tim.lewis@insyde.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] [shell] AliasLower never used in InternalSetAlias
> Importance: High
> 
> I would also note that GetAlias() has similar logic, but does, in fact use the
> AliasLower. As far as I can tell, the specification does not say anything about
> case-insensitive, so I believe this to be in error.
> 
> Tim
> 
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Tim Lewis
> Sent: Thursday, October 27, 2016 2:11 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [shell] AliasLower never used in InternalSetAlias
> 
> In the function InternalSetAlias, it appears that AliasLower is duplicated
> (fromAlias), converted to lower case and freed ,but never actually used. Am I
> missing something?
> 
>   // Convert to lowercase to make aliases case-insensitive
>   if (Alias != NULL) {
>     AliasLower = AllocateCopyPool (StrSize (Alias), Alias);
>     if (AliasLower == NULL) {
>       return EFI_OUT_OF_RESOURCES;
>     }
>     ToLower (AliasLower);
>   } else {
>     AliasLower = NULL;
>   }
> 
>   //
>   // We must be trying to remove one if Alias is NULL
>   //
>   if (Alias == NULL) {
>     //
>     // remove an alias (but passed in COMMAND parameter)
>     //
>     Status = (gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0,
> NULL));
>   } else {
>     //
>     // Add and replace are the same
>     //
> 
>     // We dont check the error return on purpose since the variable may not
> exist.
>     gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0, NULL);
> 
>     Status = (gRT->SetVariable((CHAR16*)Alias, &gShellAliasGuid,
> EFI_VARIABLE_BOOTSERVICE_ACCESS|(Volatile?0:EFI_VARIABLE_NON_VOL
> ATILE), StrSize(Command), (VOID*)Command));
>   }
> 
>   if (Alias != NULL) {
>     FreePool (AliasLower);
>   }
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2016-10-28 15:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 21:11 [shell] AliasLower never used in InternalSetAlias Tim Lewis
2016-10-27 21:29 ` Tim Lewis
2016-10-28 15:20   ` Carsey, Jaben [this message]
2016-10-28 16:48     ` Tim Lewis
2016-10-28 16:58       ` Carsey, Jaben
2016-10-28 17:03         ` Tim Lewis
2016-10-28 17:04           ` Carsey, Jaben

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=CB6E33457884FA40993F35157061515C54AB3793@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