Date: Mon, 18 Aug 2008 09:07:55 GMT From: Konrad Jankowski <konrad@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 147700 for review Message-ID: <200808180907.m7I97tJL099608@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=147700 Change 147700 by konrad@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808180907.m7I97tJL099608>