>>>>> "LT" == Linus Torvalds <[EMAIL PROTECTED]> writes:

LT> On Mon, 18 Apr 2005, Petr Baudis wrote:
>> 
>> Am I just slow or does the first dst-- make it miss the last trailing
>> /[,;.]/?

LT> Hopefully not. It _should_ make it miss the last '\0', but hey, it got my
LT> usual amount of testing (ie none). I'm sure Brad can tell us whether it
LT> makes any difference..

No, you are both slow ;-)  At that point p is not the beginning
of the input anymore.  This is a *tentative* fix to implement
your intended solution.

I have a suspicion that your intended solution would not work on
systems that really use these GECOS subfields, though.  These
commas are there to separate subfields and your intended
solution would keep the office numbers etc. as part of commiter
name.  Honestly, I think your COMMITTER_* environment variable
idea is far better than playing games like this, although at the
same time I sympathize your not wanting to encourage people to
lie about the committer identity.

Signed-off-by: Junio C Hamano <[EMAIL PROTECTED]> 
---

cd /opt/packrat/playpen/public/in-place/git/git/
show-diff commit-tree.c
commit-tree.c: ec53a4565ec0033aaf6df2a48d233ccf4823e8b0
--- commit-tree.c
+++ commit-tree.c       2005-04-17 18:43:39.000000000 -0700
@@ -83,6 +83,7 @@ static void finish_buffer(char *tag, cha
 static void remove_special(char *p)
 {
        char c;
+       char *begin = p;
        char *dst = p;
 
        for (;;) {
@@ -102,7 +103,7 @@ static void remove_special(char *p)
         * have commas etc in their gecos field
         */
        dst--;
-       while (--dst >= p) {
+       while (--dst >= begin) {
                unsigned char c = *dst;
                switch (c) {
                case ',': case ';': case '.':

Compilation finished at Sun Apr 17 18:44:55

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to