PERFORCE change 147700 for review

Konrad Jankowski konrad at FreeBSD.org
Mon Aug 18 09:07:56 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=147700

Change 147700 by konrad at vspredator on 2008/08/18 09:06:59

	Disable additional conversions, to ease debugging.

Affected files ...

.. //depot/projects/soc2008/konrad_collation/test/sort/sort.c#5 edit

Differences ...

==== //depot/projects/soc2008/konrad_collation/test/sort/sort.c#5 (text+ko) ====

@@ -14,7 +14,7 @@
 } *lines[MAXSIZE];
 
 static int
-read_input(void)
+read_input(int xfrm)
 {
 	char buf[1000];
 	int i = 0, len;
@@ -26,10 +26,12 @@
 			err(1, "malloc");
 		if ((line->sline = strdup(buf)) == NULL)
 			err(1, "strdup");
-		len = strxfrm(NULL, buf, 0);
-		if ((line->trans = malloc(len + 1)) == NULL)
-			err(1, "malloc");
-		strxfrm(line->trans, buf, len);
+		if (xfrm) {
+			len = strxfrm(NULL, buf, 0);
+			if ((line->trans = malloc(len + 1)) == NULL)
+				err(1, "malloc");
+			strxfrm(line->trans, buf, len);
+		}
 		lines[i] = line;
 		i++;
 	}
@@ -91,7 +93,7 @@
 	}
 	if ((p = setlocale(LC_ALL, "")) == NULL)
 		errx(1, "setlocale");
-	num_lines = read_input();
+	num_lines = read_input(xfrm);
 	fprintf(stderr, "setlocale: %s\n", p);
 	if (xfrm)
 		qsort(lines, num_lines, sizeof(struct line *), strcmp_compare);


More information about the p4-projects mailing list