Re: [PATCH] Detect renames in diff family.
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 19, 2005, 18:42 UTC
- Message-ID
- <7vy8abys5a.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <7v4qcz16n6.fsf@assigned-by-dhcp.cox.net>
Replying to myself.
JCH> Oops,... thanks. I still had some doubts about it and that's JCH> why I said it was beta, but that is fine. My doubts are minor:
Here is another "doubt" point. I am almost embarrassed to ask this, but what's the right way to express the following? I could not figure out how to silence const warnings from gcc without using the cast there, which defeats the whole point of const warnings:
if (!pid) {
const char *pgm = external_diff();
if (pgm) {
if (one && two) {
const char *exec_arg[9];
const char **arg = &exec_arg[0];
*arg++ = pgm;
*arg++ = name;
*arg++ = temp[0].name;
*arg++ = temp[0].hex;
*arg++ = temp[0].mode;
*arg++ = temp[1].name;
*arg++ = temp[1].hex;
*arg++ = temp[1].mode;
if (other)
*arg++ = other;
*arg = 0;
execvp(pgm, (char *const*) exec_arg);
}Here, pgm and name are const, execvp expects char *const argv[] as its second argument.