Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Denis PILAT <denis.pilat@st.com>
Cc: drow@false.org, gdb-patches@sourceware.org
Subject: Re: [RFC] usage of environment variable from the command line
Date: Sat, 22 Dec 2007 19:27:00 -0000	[thread overview]
Message-ID: <ubq8iip0a.fsf@gnu.org> (raw)
In-Reply-To: <476BCE30.50803@st.com> (message from Denis PILAT on Fri, 21 Dec 	2007 15:31:12 +0100)

> 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?


      reply	other threads:[~2007-12-22 18:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 15:24 Denis PILAT
2007-09-21 22:55 ` Daniel Jacobowitz
2007-09-22  7:16   ` Eli Zaretskii
2007-09-22 13:58     ` Daniel Jacobowitz
2007-09-24 15:05       ` Denis PILAT
2007-09-24 16:44       ` Jim Blandy
2007-09-24 21:41         ` Eli Zaretskii
2007-09-25 17:11           ` Jim Blandy
2007-09-25 21:38             ` Eli Zaretskii
2007-09-30  1:30         ` Daniel Jacobowitz
2007-09-30  7:17           ` Eli Zaretskii
2007-10-11 17:51             ` Daniel Jacobowitz
2007-12-21 15:31             ` Denis PILAT
2007-12-22 19:27               ` Eli Zaretskii [this message]

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-all 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=ubq8iip0a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=denis.pilat@st.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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