~eschwartz/foo-test

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[pacman-dev] [PATCH 1/2] check for valid optarg before using strdup

Details
Message ID
<1272214084-22722-1-git-send-email-ftrvxmtrx@gmail.com>
DKIM signature
missing
Download raw message
Patch: +1 -0
Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>
---
 src/pacman/pacman.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index d32d4d1..206cdcf 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -489,6 +489,7 @@ static int parseargs(int argc, char *argv[])
				setarch(optarg);
				break;
			case OP_PRINTFORMAT:
				check_optarg();
				config->print_format = strdup(optarg);
				break;
			case 'Q': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_QUERY); break;
-- 
1.7.0.6

[pacman-dev] [PATCH 2/2] remove dead assignment, spotted by clang

Details
Message ID
<1272214084-22722-2-git-send-email-ftrvxmtrx@gmail.com>
In-Reply-To
<1272214084-22722-1-git-send-email-ftrvxmtrx@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Patch: +0 -1
Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>
---
 src/pacman/util.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/pacman/util.c b/src/pacman/util.c
index 5099237..c37c8b0 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -648,7 +648,6 @@ void print_packages(const alpm_list_t *packages)
			string = strreplace(temp, "%s", size);
			free(size);
			free(temp);
			temp = string;
		}
		printf("%s\n",string);
		free(string);
-- 
1.7.0.6

Re: [pacman-dev] [PATCH 2/2] remove dead assignment, spotted by clang

Allan McRae <allan@archlinux.org>
Details
Message ID
<4BD4E68E.5020303@archlinux.org>
In-Reply-To
<1272214084-22722-2-git-send-email-ftrvxmtrx@gmail.com> (view parent)
DKIM signature
missing
Download raw message
On 26/04/10 02:48, Serge Ziryukin wrote:
> Signed-off-by: Serge Ziryukin<ftrvxmtrx@gmail.com>
> ---
>   src/pacman/util.c |    1 -
>   1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/src/pacman/util.c b/src/pacman/util.c
> index 5099237..c37c8b0 100644
> --- a/src/pacman/util.c
> +++ b/src/pacman/util.c
> @@ -648,7 +648,6 @@ void print_packages(const alpm_list_t *packages)
>   			string = strreplace(temp, "%s", size);
>   			free(size);
>   			free(temp);
> -			temp = string;
>   		}
>   		printf("%s\n",string);
>   		free(string);


I'd prefer to keep this there.  That way, if any further fields get 
added below that one, we will not have to remember to put that line 
back.  That line should be optimized away by any good compiler anyway.

Allan
Allan McRae <allan@archlinux.org>
Details
Message ID
<4BD4E9D5.1010705@archlinux.org>
In-Reply-To
<1272214084-22722-1-git-send-email-ftrvxmtrx@gmail.com> (view parent)
DKIM signature
missing
Download raw message
On 26/04/10 02:48, Serge Ziryukin wrote:
> Signed-off-by: Serge Ziryukin<ftrvxmtrx@gmail.com>
> ---
>   src/pacman/pacman.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
> index d32d4d1..206cdcf 100644
> --- a/src/pacman/pacman.c
> +++ b/src/pacman/pacman.c
> @@ -489,6 +489,7 @@ static int parseargs(int argc, char *argv[])
>   				setarch(optarg);
>   				break;
>   			case OP_PRINTFORMAT:
> +				check_optarg();
>   				config->print_format = strdup(optarg);
>   				break;
>   			case 'Q': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_QUERY); break;

Looks good.  Although, in all likelihood it will rarely capture the 
missing argument:

pacman -Sp --print-format kdelibs
error: no targets specified (use -h for help)

pacman -Sp kdelibs --print-format
pacman: option '--print-format' requires an argument

Pulled to my working branch.

Allan
Reply to thread Export thread (mbox)