[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: cmd: Check for argument in copy, mkdir, delete, goto, move,
From: Alexandre Julliard <julliard () winehq ! org>
Date: 2006-10-31 19:35:28
Message-ID: 87ac3c6zy7.fsf () wine ! dyndns ! org
[Download RAW message or body]
Markus Amsler <markus.amsler@oribi.org> writes:
> This fixes bug http://bugs.winehq.org/show_bug.cgi?id=6286
> ---
> programs/cmd/builtins.c | 22 ++++++++++++++++++++++
> 1 files changed, 22 insertions(+), 0 deletions(-)
> diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
> index 3329a0b..0732170 100644
> --- a/programs/cmd/builtins.c
> +++ b/programs/cmd/builtins.c
> @@ -36,6 +36,12 @@ #define WIN32_LEAN_AND_MEAN
>
> #include "wcmd.h"
>
> +#define CHECK_FOR_ARGUMENT \
> + if (param1[0] == 0x00) { \
> + WCMD_output ("Argument missing\n"); \
> + return; \
> + }
> +
> void WCMD_execute (char *orig_command, char *parameter, char *substitution);
>
> struct env_stack
> @@ -110,6 +116,8 @@ BOOL force, status;
> static const char overwrite[] = "Overwrite file (Y/N)?";
> char string[8], outpath[MAX_PATH], inpath[MAX_PATH], *infile;
>
> + CHECK_FOR_ARGUMENT
> +
> if ((strchr(param1,'*') != NULL) && (strchr(param1,'%') != NULL)) {
This is ugly, you should use a normal function instead of a macro and
do the return explicitly instead of hiding it in the macro (or even
put the code in as is, it's only a couple of lines).
--
Alexandre Julliard
julliard@winehq.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic