Skip to Content.
Sympa Menu

sm-commit - Re: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (24e9e3d9e230efb021c291b7ddfc56369af7119a)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <lynx AT mages.ath.cx>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: Re: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (24e9e3d9e230efb021c291b7ddfc56369af7119a)
  • Date: Sun, 3 Feb 2008 11:45:19 +0100

On Sunday 03 of February 2008 00:47:04 flux wrote:
> > @@ -399,7 +399,13 @@ function unpack_gpg() {
> > rc="$?"
> > case "$rc" in
> > 0)
> > - if is_allowed_hash $GPGALGO_USED $GPGLEVEL ; then rc=0 ; else rc=1
> > ; fi + local algo
> > + for algo in $GPGALGO_USED; do
> > + if is_allowed_hash "$algo" "$GPGLEVEL"; then
> > + rc=0
> > + break
> > + fi
> > + done
> > ;;
>
> </snip>
>
> Should the setting of rc inside the for loop be rc=$? instead of rc=0?
> Since the for loop occurs inside of a case where rc already is 0,
> setting rc=0 again seems like duplication/wasted code. Also, the
No, since an allowed algorithm could be the last we check. And changing the
assignement to $? wouldn't change anything, since it is in an if block.

> original if statement included a case where the algo failed
> is_allowed_hash and subsequently rc=1. Is it really only supposed to be
> rc=0 here and I am missing something, or is this in fact an error?
Nice catch. It should set rc to 1 on failure (none of the algorithms are
allowed).

--
We cannot command nature except by obeying her. --Sir Francis Bacon
Have a sourcerous day! www.sourcemage.org

Attachment: signature.asc
Description: This is a digitally signed message part.




Archive powered by MHonArc 2.6.24.

Top of Page