Sparse: fix a "symbol 'weak_match' shadows an earlier one" warning
RFC PATCH 10/10 Sparse: fix a "symbol 'weak_match' shadows an earlier one" warning
--- connect.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
connect.c +0 -1
@@ -179,7 +179,6 @@ static int count_refspec_match(const char *pattern,for (weak_match = match =0 ; refs; refs = refs->next) {char *name = refs->name;int namelen =strlen (name); -int weak_match;if (namelen < patlen ||memcmp (name + namelen - patlen, pattern, patlen))
Signature · 1 line
1.5.2
Quoted 10 lines · Ramsay Jones
Signed-off-by Ramsay Jones <[email protected]>--- connect.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)connect.c +0
-0
connect.c static int count_refspec_match(const char *pattern, · line 184
Quoted 7 lines
connect.c +0
-1@@ -179,7 +179,6 @@ static int count_refspec_match(const char *pattern,for (weak_match = match =0 ; refs; refs = refs->next) {char *name = refs->name;int namelen =strlen (name); -int weak_match;if (namelen < patlen ||memcmp (name + namelen - patlen, pattern, patlen))
This one is an obvious bug. Essentially, it makes weak matches ignored. Unfortunately this has been hiding a larger bug in the caller of this function. I am refactoring the mess right now.
Quoted 17 lines · Junio C Hamano
Quoted 15 lines · Ramsay Jones
Signed-off-by Ramsay Jones <[email protected]>--- connect.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)connect.c +0
-1@@ -179,7 +179,6 @@ static int count_refspec_match(const char *pattern,for (weak_match = match =0 ; refs; refs = refs->next) {char *name = refs->name;int namelen =strlen (name); -int weak_match;
Quoted 4 lines
connect.c static int count_refspec_match(const char *pattern, · line 184
Quoted 2 lines
connect.c +0
-0if (namelen < patlen ||memcmp (name + namelen - patlen, pattern, patlen))This one is an obvious bug.
Indeed ;-)
Also, I'm guessing it does not bring your machine down like a house of cards.
... Essentially, it makes weak matches
Quoted 3 lines
ignored. Unfortunately this has been hiding a larger bug in the caller of this function. I am refactoring the mess right now.
Great. Hopefully it will also address the cygwin issue.
ATB
Ramsay Jones