Skip to contentSkip to conversation

libexport.a: fix a long-standing typo in name_cmp()

PATCH In review Chuck Lever 2 participants 2 messages Dec 11, 2009 – Dec 23, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libexport.a: fix a long-standing typo in name_cmp()

Not sure what "(!*a || !a == ',')" means... but just a few lines later is "(!*a || *a == ',')". I think "a is '\0' or ','" is what was intended.

---

Neil --

Looks like a typo. Comments?

 support/export/client.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
support/export/client.c +1 -1
index b08dda2..cb6e659 100644
@@ -266,7 +266,7 @@ name_cmp(char *a, char *b)
 	/* compare strings a and b, but only upto ',' in a */
 	while (*a && *b && *a != ',' && *a == *b)
 		a++, b++;
-	if (!*b && (!*a || !a == ',') )
+	if (!*b && (!*a || *a == ','))
 		return 0;
 	if (!*b) return 1;
 	if (!*a || *a == ',') return -1;
#2 lore raw
In reply to a message not in the archive
Quoted 19 lines · Chuck Lever

Not sure what "(!*a || !a == ',')" means... but just a few lines later is "(!*a || *a == ',')". I think "a is '\0' or ','" is what was intended.

---

Neil --

Looks like a typo. Comments?

 support/export/client.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
support/export/client.c +0 -0
index b08dda2..cb6e659 100644

support/export/client.c name_cmp(char *a, char *b) · line 272

Quoted 8 lines
support/export/client.c +1 -1
@@ -266,7 +266,7 @@ name_cmp(char *a, char *b)
 	/* compare strings a and b, but only upto ',' in a */
 	while (*a && *b && *a != ',' && *a == *b)
 		a++, b++;
-	if (!*b && (!*a || !a == ',') )
+	if (!*b && (!*a || *a == ','))
 		return 0;
 	if (!*b) return 1;
 	if (!*a || *a == ',') return -1;

Committed...

steved.