[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/6] graphs: style: use left justification for states
From: |
Akim Demaille |
Subject: |
Re: [PATCH 3/6] graphs: style: use left justification for states |
Date: |
Thu, 11 Oct 2012 09:36:28 +0200 |
Hi Théophile,
Le 10 oct. 2012 à 19:14, Theophile Ranquet a écrit :
> +static char *escape_buffer = NULL;
> +
> +void
> +free_escape_buffer ()
> +{
> + free (escape_buffer);
> + escape_buffer = NULL;
> +}
> +
> +char const *
> +escape (char const *name)
> +{
> + struct quoting_options *o = NULL;
> + if (! o)
> + {
> + o = clone_quoting_options (NULL);
> + set_quoting_style (o, escape_quoting_style);
> + set_char_quoting (o, '"', 1);
> + }
> + escape_buffer = quotearg_alloc (name, strlen (name), o);
> + return escape_buffer;
> +}
We already discussed about this, and really, I don't
like this. The solution I promoted is _much_ simpler,
and safer too. Yet, your proposal would be improved
if you'd call free_escape_buffer from escape itself,
to relieve the "regular" callers from having to do it.
Just leave the final clean call.
But then again, I prefer that you'd use quotearg's
buffers, not introducing more mallocs. That's also
wasting resources, since quotearg avoids gratuitous
malloc/free traffic.
- [PATCH 0/6] {maint} Graphviz improvements, Theophile Ranquet, 2012/10/10
- [PATCH 1/6] obstack: import obstack_finish0 from master, Theophile Ranquet, 2012/10/10
- [PATCH 2/6] graphs: style: prefix rules and change shapes, Theophile Ranquet, 2012/10/10
- [PATCH 3/6] graphs: style: use left justification for states, Theophile Ranquet, 2012/10/10
- Re: [PATCH 3/6] graphs: style: use left justification for states,
Akim Demaille <=
- Re: [PATCH 3/6] graphs: style: use left justification for states, Théophile Ranquet, 2012/10/11
- Re: [PATCH 3/6] graphs: style: use left justification for states, Théophile Ranquet, 2012/10/11
- Re: [PATCH 3/6] graphs: style: use left justification for states, Théophile Ranquet, 2012/10/11
- Re: [PATCH 3/6] graphs: style: use left justification for states, Akim Demaille, 2012/10/11
- Re: [PATCH 3/6] graphs: style: use left justification for states, Théophile Ranquet, 2012/10/11
- Re: [PATCH 3/6] graphs: style: use left justification for states, Théophile Ranquet, 2012/10/11
- Re: [PATCH 3/6] graphs: style: use left justification for states, Akim Demaille, 2012/10/11
[PATCH 5/6] graphs: show reductions, Theophile Ranquet, 2012/10/10
[PATCH 4/6] graphs: style: prefix state number with "state", Theophile Ranquet, 2012/10/10
[PATCH 6/6] graphs: documentation, Theophile Ranquet, 2012/10/10