This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] usage of environment variable from the command line


> Date: Fri, 21 Dec 2007 15:31:12 +0100
> From: Denis PILAT <denis.pilat@st.com>
> Cc: gdb-patches@sourceware.org
> 
> The old discussion was here: 
> http://sources.redhat.com/ml/gdb-patches/2007-09/msg00430.html
> My point is:
> - What do you mean by a specification ?

That question was directed at Daniel, not you.

> - You also told about quoting issues, could you please be more precise ? 

That was Daniel, so he should respond.  I guess he meant literal "${"
strings, which could legitimately be part of input.

> +#define ENV_DELIMITOR_BEGIN  "${"
> +#define ENV_DELIMITOR_END  "}"

Please use DELIMITER, not DELIMITOR.

> +  int env_var_len, delimitor_begin_len, delimitor_end_len;
                      ^^^^^^^^^            ^^^^^^^^^
Same here.

> +  delimitor_begin_len = strlen(ENV_DELIMITOR_BEGIN);
> +  delimitor_end_len = strlen(ENV_DELIMITOR_END);

Coding style: a space between function's name and the left
parenthesis.

> +  /* replace this value into the original string.  */
> +  output = xmalloc (strlen (input) + strlen (env_var_value) - env_var_len - delimitor_begin_len - delimitor_end_len + 1);

This line is too long, please break into two.

> +  p = evaluate_environment_from_string (p);

Are we perhaps leaking memory pointed to by `p' before the above line
executes?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]