- Timestamp:
- Jan 8, 2009, 8:16:38 PM (16 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 7f8be39
- Parents:
- 73fbec10
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
patches/coreutils-6.12-i18n-1.patch
r73fbec10 rd33f80c 3 3 Initial Package Version: 6.12 4 4 Upstream Status: Unkown 5 Origin: Fedora and Bryan Kadzban5 Origin: Mandriva 6 6 Description: i18n Updates 7 7 8 8 diff -Naur coreutils-6.12.orig/lib/linebuffer.h coreutils-6.12/lib/linebuffer.h 9 9 --- coreutils-6.12.orig/lib/linebuffer.h 2007-10-17 06:47:26.000000000 -0700 10 +++ coreutils-6.12/lib/linebuffer.h 2009-01-08 12:56:49.000000000 -080010 +++ coreutils-6.12/lib/linebuffer.h 2009-01-08 20:14:37.000000000 -0800 11 11 @@ -21,6 +21,11 @@ 12 12 … … 33 33 diff -Naur coreutils-6.12.orig/src/cut.c coreutils-6.12/src/cut.c 34 34 --- coreutils-6.12.orig/src/cut.c 2008-05-25 23:40:33.000000000 -0700 35 +++ coreutils-6.12/src/cut.c 2009-01-08 12:56:49.000000000 -080035 +++ coreutils-6.12/src/cut.c 2009-01-08 20:14:37.000000000 -0800 36 36 @@ -28,6 +28,11 @@ 37 37 #include <assert.h> … … 627 627 diff -Naur coreutils-6.12.orig/src/expand.c coreutils-6.12/src/expand.c 628 628 --- coreutils-6.12.orig/src/expand.c 2008-05-25 23:40:33.000000000 -0700 629 +++ coreutils-6.12/src/expand.c 2009-01-08 12:56:49.000000000 -0800629 +++ coreutils-6.12/src/expand.c 2009-01-08 20:14:37.000000000 -0800 630 630 @@ -37,11 +37,28 @@ 631 631 #include <stdio.h> … … 824 824 diff -Naur coreutils-6.12.orig/src/fold.c coreutils-6.12/src/fold.c 825 825 --- coreutils-6.12.orig/src/fold.c 2008-05-25 23:40:33.000000000 -0700 826 +++ coreutils-6.12/src/fold.c 2009-01-08 12:56:49.000000000 -0800826 +++ coreutils-6.12/src/fold.c 2009-01-08 20:14:37.000000000 -0800 827 827 @@ -22,11 +22,33 @@ 828 828 #include <getopt.h> … … 1230 1230 diff -Naur coreutils-6.12.orig/src/join.c coreutils-6.12/src/join.c 1231 1231 --- coreutils-6.12.orig/src/join.c 2008-05-25 23:40:32.000000000 -0700 1232 +++ coreutils-6.12/src/join.c 2009-01-08 12:56:49.000000000 -08001232 +++ coreutils-6.12/src/join.c 2009-01-08 20:14:37.000000000 -0800 1233 1233 @@ -22,17 +22,31 @@ 1234 1234 #include <sys/types.h> … … 1281 1281 /* If nonzero, check that the input is correctly ordered. */ 1282 1282 static enum 1283 @@ -230,10 +246,11 @@ 1283 @@ -221,6 +237,8 @@ 1284 1285 /* Fill in the `fields' structure in LINE. */ 1286 1287 +/* Fill in the `fields' structure in LINE. */ 1288 + 1289 static void 1290 xfields (struct line *line) 1291 { 1292 @@ -230,10 +248,11 @@ 1284 1293 if (ptr == lim) 1285 1294 return; … … 1295 1304 } 1296 1305 else 1297 @@ -260,6 +277,148 @@ 1298 extract_field (line, ptr, lim - ptr); 1299 } 1300 1301 +#if HAVE_MBRTOWC 1302 +static void 1303 +xfields_multibyte (struct line *line) 1304 +{ 1305 + char *ptr = line->buf.buffer; 1306 + char const *lim = ptr + line->buf.length - 1; 1307 + wchar_t wc = 0; 1308 + size_t mblength = 1; 1309 + mbstate_t state, state_bak; 1310 + 1311 + memset (&state, 0, sizeof (mbstate_t)); 1312 + 1313 + if (ptr == lim) 1314 + return; 1315 + 1316 + if (tab != NULL) 1317 + { 1318 + unsigned char t = tab[0]; 1319 + char *sep = ptr; 1320 + for (; ptr < lim; ptr = sep + mblength) 1321 + { 1322 + sep = ptr; 1323 + while (sep < lim) 1324 + { 1325 + state_bak = state; 1326 + mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); 1327 + 1328 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1329 + { 1330 + mblength = 1; 1331 + state = state_bak; 1332 + } 1333 + mblength = (mblength < 1) ? 1 : mblength; 1334 + 1335 + if (mblength == tablen && !memcmp (sep, tab, mblength)) 1336 + break; 1337 + else 1338 + { 1339 + sep += mblength; 1340 + continue; 1341 + } 1342 + } 1343 + 1344 + if (sep == lim) 1345 + break; 1346 + 1347 + extract_field (line, ptr, sep - ptr); 1348 + } 1349 + } 1350 + else 1351 + { 1352 + /* Skip leading blanks before the first field. */ 1353 + while(ptr < lim) 1354 + { 1355 + state_bak = state; 1356 + mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); 1357 + 1358 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1359 + { 1360 + mblength = 1; 1361 + state = state_bak; 1362 + break; 1363 + } 1364 + mblength = (mblength < 1) ? 1 : mblength; 1365 + 1366 + if (!iswblank(wc)) 1367 + break; 1368 + ptr += mblength; 1369 + } 1370 + 1371 + do 1372 + { 1373 + char *sep; 1374 + state_bak = state; 1375 + mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); 1376 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1377 + { 1378 + mblength = 1; 1379 + state = state_bak; 1380 + break; 1381 + } 1382 + mblength = (mblength < 1) ? 1 : mblength; 1383 + 1384 + sep = ptr + mblength; 1385 + while (sep != lim) 1386 + { 1387 + state_bak = state; 1388 + mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); 1389 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1390 + { 1391 + mblength = 1; 1392 + state = state_bak; 1393 + break; 1394 + } 1395 + mblength = (mblength < 1) ? 1 : mblength; 1396 + 1397 + if (iswblank (wc)) 1398 + break; 1399 + 1400 + sep += mblength; 1401 + } 1402 + 1403 + extract_field (line, ptr, sep - ptr); 1404 + if (sep == lim) 1405 + return; 1406 + 1407 + state_bak = state; 1408 + mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); 1409 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1410 + { 1411 + mblength = 1; 1412 + state = state_bak; 1413 + break; 1414 + } 1415 + mblength = (mblength < 1) ? 1 : mblength; 1416 + 1417 + ptr = sep + mblength; 1418 + while (ptr != lim) 1419 + { 1420 + state_bak = state; 1421 + mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); 1422 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1423 + { 1424 + mblength = 1; 1425 + state = state_bak; 1426 + break; 1427 + } 1428 + mblength = (mblength < 1) ? 1 : mblength; 1429 + 1430 + if (!iswblank (wc)) 1431 + break; 1432 + 1433 + ptr += mblength; 1434 + } 1435 + } 1436 + while (ptr != lim); 1437 + } 1438 + 1439 + extract_field (line, ptr, lim - ptr); 1440 +} 1441 +#endif 1442 + 1443 static struct line * 1444 dup_line (const struct line *old) 1445 { 1446 @@ -305,56 +464,115 @@ 1306 @@ -305,56 +324,115 @@ 1447 1307 size_t jf_1, size_t jf_2) 1448 1308 { … … 1455 1315 + char *beg[2]; 1456 1316 + char *copy[2]; 1457 + size_t len[2]; 1317 + size_t len[2]; /* Length of fields to compare. */ 1458 1318 int diff; 1459 1319 + int i, j; … … 1583 1443 1584 1444 /* Check that successive input lines PREV and CURRENT from input file 1585 @@ -413,6 +631,11 @@ 1445 @@ -393,6 +471,148 @@ 1446 } 1447 } 1448 1449 +#if HAVE_MBRTOWC 1450 +static void 1451 +xfields_multibyte (struct line *line) 1452 +{ 1453 + char *ptr = line->buf.buffer; 1454 + char const *lim = ptr + line->buf.length - 1; 1455 + wchar_t wc = 0; 1456 + size_t mblength = 1; 1457 + mbstate_t state, state_bak; 1458 + 1459 + memset (&state, 0, sizeof (mbstate_t)); 1460 + 1461 + if (ptr == lim) 1462 + return; 1463 + 1464 + if (tab != NULL) 1465 + { 1466 + unsigned char t = tab[0]; 1467 + char *sep = ptr; 1468 + for (; ptr < lim; ptr = sep + mblength) 1469 + { 1470 + sep = ptr; 1471 + while (sep < lim) 1472 + { 1473 + state_bak = state; 1474 + mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); 1475 + 1476 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1477 + { 1478 + mblength = 1; 1479 + state = state_bak; 1480 + } 1481 + mblength = (mblength < 1) ? 1 : mblength; 1482 + 1483 + if (mblength == tablen && !memcmp (sep, tab, mblength)) 1484 + break; 1485 + else 1486 + { 1487 + sep += mblength; 1488 + continue; 1489 + } 1490 + } 1491 + 1492 + if (sep == lim) 1493 + break; 1494 + 1495 + extract_field (line, ptr, sep - ptr); 1496 + } 1497 + } 1498 + else 1499 + { 1500 + /* Skip leading blanks before the first field. */ 1501 + while(ptr < lim) 1502 + { 1503 + state_bak = state; 1504 + mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); 1505 + 1506 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1507 + { 1508 + mblength = 1; 1509 + state = state_bak; 1510 + break; 1511 + } 1512 + mblength = (mblength < 1) ? 1 : mblength; 1513 + 1514 + if (!iswblank(wc)) 1515 + break; 1516 + ptr += mblength; 1517 + } 1518 + 1519 + do 1520 + { 1521 + char *sep; 1522 + state_bak = state; 1523 + mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); 1524 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1525 + { 1526 + mblength = 1; 1527 + state = state_bak; 1528 + break; 1529 + } 1530 + mblength = (mblength < 1) ? 1 : mblength; 1531 + 1532 + sep = ptr + mblength; 1533 + while (sep != lim) 1534 + { 1535 + state_bak = state; 1536 + mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); 1537 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1538 + { 1539 + mblength = 1; 1540 + state = state_bak; 1541 + break; 1542 + } 1543 + mblength = (mblength < 1) ? 1 : mblength; 1544 + 1545 + if (iswblank (wc)) 1546 + break; 1547 + 1548 + sep += mblength; 1549 + } 1550 + 1551 + extract_field (line, ptr, sep - ptr); 1552 + if (sep == lim) 1553 + return; 1554 + 1555 + state_bak = state; 1556 + mblength = mbrtowc (&wc, sep, lim - sep + 1, &state); 1557 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1558 + { 1559 + mblength = 1; 1560 + state = state_bak; 1561 + break; 1562 + } 1563 + mblength = (mblength < 1) ? 1 : mblength; 1564 + 1565 + ptr = sep + mblength; 1566 + while (ptr != lim) 1567 + { 1568 + state_bak = state; 1569 + mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state); 1570 + if (mblength == (size_t)-1 || mblength == (size_t)-2) 1571 + { 1572 + mblength = 1; 1573 + state = state_bak; 1574 + break; 1575 + } 1576 + mblength = (mblength < 1) ? 1 : mblength; 1577 + 1578 + if (!iswblank (wc)) 1579 + break; 1580 + 1581 + ptr += mblength; 1582 + } 1583 + } 1584 + while (ptr != lim); 1585 + } 1586 + 1587 + extract_field (line, ptr, lim - ptr); 1588 +} 1589 +#endif 1590 + 1591 /* Read a line from FP into LINE and split it into fields. 1592 Return true if successful. */ 1593 1594 @@ -413,6 +633,11 @@ 1586 1595 line->nfields_allocated = 0; 1587 1596 line->nfields = 0; … … 1595 1604 1596 1605 if (prevline[which - 1]) 1597 @@ -509,11 +73 2,18 @@1606 @@ -509,11 +734,18 @@ 1598 1607 1599 1608 /* Print the join of LINE1 and LINE2. */ … … 1615 1624 outlist = outlist_head.next; 1616 1625 if (outlist) 1617 @@ -529,12 +7 59,12 @@1626 @@ -529,12 +761,12 @@ 1618 1627 if (o->file == 0) 1619 1628 { … … 1630 1639 field = join_field_1; 1631 1640 } 1632 @@ -548,7 +7 78,7 @@1641 @@ -548,7 +780,7 @@ 1633 1642 o = o->next; 1634 1643 if (o == NULL) … … 1639 1648 putchar ('\n'); 1640 1649 } 1641 @@ -566,23 +79 6,23 @@1650 @@ -566,23 +798,23 @@ 1642 1651 prfield (join_field_1, line1); 1643 1652 for (i = 0; i < join_field_1 && i < line1->nfields; ++i) … … 1667 1676 } 1668 1677 putchar ('\n'); 1669 @@ -1016,20 +124 6,41 @@1678 @@ -1016,20 +1248,41 @@ 1670 1679 1671 1680 case 't': … … 1721 1730 diff -Naur coreutils-6.12.orig/src/pr.c coreutils-6.12/src/pr.c 1722 1731 --- coreutils-6.12.orig/src/pr.c 2008-05-25 23:40:32.000000000 -0700 1723 +++ coreutils-6.12/src/pr.c 2009-01-08 12:56:50.000000000 -08001732 +++ coreutils-6.12/src/pr.c 2009-01-08 20:14:37.000000000 -0800 1724 1733 @@ -312,6 +312,32 @@ 1725 1734 … … 2446 2455 diff -Naur coreutils-6.12.orig/src/sort.c coreutils-6.12/src/sort.c 2447 2456 --- coreutils-6.12.orig/src/sort.c 2008-05-25 23:40:32.000000000 -0700 2448 +++ coreutils-6.12/src/sort.c 2009-01-08 12:56:50.000000000 -08002457 +++ coreutils-6.12/src/sort.c 2009-01-08 20:14:37.000000000 -0800 2449 2458 @@ -22,10 +22,19 @@ 2450 2459 … … 3315 3324 diff -Naur coreutils-6.12.orig/src/unexpand.c coreutils-6.12/src/unexpand.c 3316 3325 --- coreutils-6.12.orig/src/unexpand.c 2008-05-25 23:40:33.000000000 -0700 3317 +++ coreutils-6.12/src/unexpand.c 2009-01-08 12:56:50.000000000 -08003326 +++ coreutils-6.12/src/unexpand.c 2009-01-08 20:14:37.000000000 -0800 3318 3327 @@ -38,11 +38,28 @@ 3319 3328 #include <stdio.h> … … 3570 3579 diff -Naur coreutils-6.12.orig/src/uniq.c coreutils-6.12/src/uniq.c 3571 3580 --- coreutils-6.12.orig/src/uniq.c 2008-05-25 23:40:32.000000000 -0700 3572 +++ coreutils-6.12/src/uniq.c 2009-01-08 12:56:50.000000000 -08003581 +++ coreutils-6.12/src/uniq.c 2009-01-08 20:14:37.000000000 -0800 3573 3582 @@ -22,6 +22,16 @@ 3574 3583 #include <getopt.h> … … 3939 3948 diff -Naur coreutils-6.12.orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am 3940 3949 --- coreutils-6.12.orig/tests/Makefile.am 2008-05-27 04:47:53.000000000 -0700 3941 +++ coreutils-6.12/tests/Makefile.am 2009-01-08 12:56:50.000000000 -08003950 +++ coreutils-6.12/tests/Makefile.am 2009-01-08 20:14:37.000000000 -0800 3942 3951 @@ -191,6 +191,7 @@ 3943 3952 misc/shuf \ … … 3959 3968 pr/0FF \ 3960 3969 pr/0FFnt \ 3961 diff -Naur coreutils-6.12.orig/tests/misc/cut coreutils-6.12/tests/misc/cut3962 --- coreutils-6.12.orig/tests/misc/cut 2008-05-16 23:41:11.000000000 -07003963 +++ coreutils-6.12/tests/misc/cut 2009-01-08 12:56:50.000000000 -08003964 @@ -26,7 +26,7 @@3965 my $prog = 'cut';3966 my $try = "Try \`$prog --help' for more information.\n";3967 my $from_1 = "$prog: fields and positions are numbered from 1\n$try";3968 -my $inval = "$prog: invalid byte or field list\n$try";3969 +my $inval = "$prog: invalid byte, character or field list\n$try";3970 my $no_endpoint = "$prog: invalid range with no endpoint: -\n$try";3971 3972 my @Tests =3973 @@ -141,7 +141,7 @@3974 3975 # None of the following invalid ranges provoked an error up to coreutils-6.9.3976 ['inval1', qw(-f 2-0), {IN=>''}, {OUT=>''}, {EXIT=>1},3977 - {ERR=>"$prog: invalid decreasing range\n$try"}],3978 + {ERR=>"$inval"}],3979 ['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],3980 ['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],3981 ['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],3982 3970 diff -Naur coreutils-6.12.orig/tests/misc/mb1.I coreutils-6.12/tests/misc/mb1.I 3983 3971 --- coreutils-6.12.orig/tests/misc/mb1.I 1969-12-31 16:00:00.000000000 -0800 3984 +++ coreutils-6.12/tests/misc/mb1.I 2009-01-08 12:56:50.000000000 -08003972 +++ coreutils-6.12/tests/misc/mb1.I 2009-01-08 20:14:37.000000000 -0800 3985 3973 @@ -0,0 +1,4 @@ 3986 +AppleïŒ 3987 +BananaïŒ 3988 +CitrusïŒ 3989 +CherryïŒ 3974 +AppleïŒ 10 3975 +BananaïŒ 5 3976 +CitrusïŒ 20 3977 +CherryïŒ 30 3990 3978 diff -Naur coreutils-6.12.orig/tests/misc/mb1.X coreutils-6.12/tests/misc/mb1.X 3991 3979 --- coreutils-6.12.orig/tests/misc/mb1.X 1969-12-31 16:00:00.000000000 -0800 3992 +++ coreutils-6.12/tests/misc/mb1.X 2009-01-08 12:56:50.000000000 -08003980 +++ coreutils-6.12/tests/misc/mb1.X 2009-01-08 20:14:37.000000000 -0800 3993 3981 @@ -0,0 +1,4 @@ 3994 +BananaïŒ 3995 +AppleïŒ 3996 +CitrusïŒ 3997 +CherryïŒ 3982 +BananaïŒ 5 3983 +AppleïŒ 10 3984 +CitrusïŒ 20 3985 +CherryïŒ 30 3998 3986 diff -Naur coreutils-6.12.orig/tests/misc/mb2.I coreutils-6.12/tests/misc/mb2.I 3999 3987 --- coreutils-6.12.orig/tests/misc/mb2.I 1969-12-31 16:00:00.000000000 -0800 4000 +++ coreutils-6.12/tests/misc/mb2.I 2009-01-08 12:56:50.000000000 -08003988 +++ coreutils-6.12/tests/misc/mb2.I 2009-01-08 20:14:37.000000000 -0800 4001 3989 @@ -0,0 +1,4 @@ 4002 +AppleïŒ ïŒ¡ïŒ¡10ïŒ ïŒ204003 +BananaïŒ ïŒ¡ïŒ¡5ïŒ ïŒ304004 +CitrusïŒ ïŒ¡ïŒ¡20ïŒ ïŒ54005 +CherryïŒ ïŒ¡ïŒ¡30ïŒ ïŒ103990 +AppleïŒ ïŒ¡ïŒ¡10ïŒ ïŒ 20 3991 +BananaïŒ ïŒ¡ïŒ¡5ïŒ ïŒ 30 3992 +CitrusïŒ ïŒ¡ïŒ¡20ïŒ ïŒ 5 3993 +CherryïŒ ïŒ¡ïŒ¡30ïŒ ïŒ 10 4006 3994 diff -Naur coreutils-6.12.orig/tests/misc/mb2.X coreutils-6.12/tests/misc/mb2.X 4007 3995 --- coreutils-6.12.orig/tests/misc/mb2.X 1969-12-31 16:00:00.000000000 -0800 4008 +++ coreutils-6.12/tests/misc/mb2.X 2009-01-08 12:56:50.000000000 -08003996 +++ coreutils-6.12/tests/misc/mb2.X 2009-01-08 20:14:37.000000000 -0800 4009 3997 @@ -0,0 +1,4 @@ 4010 +CitrusïŒ ïŒ¡ïŒ¡20ïŒ ïŒ54011 +CherryïŒ ïŒ¡ïŒ¡30ïŒ ïŒ104012 +AppleïŒ ïŒ¡ïŒ¡10ïŒ ïŒ204013 +BananaïŒ ïŒ¡ïŒ¡5ïŒ ïŒ303998 +CitrusïŒ ïŒ¡ïŒ¡20ïŒ ïŒ 5 3999 +CherryïŒ ïŒ¡ïŒ¡30ïŒ ïŒ 10 4000 +AppleïŒ ïŒ¡ïŒ¡10ïŒ ïŒ 20 4001 +BananaïŒ ïŒ¡ïŒ¡5ïŒ ïŒ 30 4014 4002 diff -Naur coreutils-6.12.orig/tests/misc/sort-mb-tests coreutils-6.12/tests/misc/sort-mb-tests 4015 4003 --- coreutils-6.12.orig/tests/misc/sort-mb-tests 1969-12-31 16:00:00.000000000 -0800 4016 +++ coreutils-6.12/tests/misc/sort-mb-tests 2009-01-08 12:56:50.000000000 -08004004 +++ coreutils-6.12/tests/misc/sort-mb-tests 2009-01-08 20:14:37.000000000 -0800 4017 4005 @@ -0,0 +1,58 @@ 4018 4006 +#! /bin/sh … … 4031 4019 +errors=0 4032 4020 + 4033 +$xx -t ïŒ 4021 +$xx -t ïŒ -k2 -n misc/mb1.I > misc/mb1.O 4034 4022 +code=$? 4035 4023 +if test $code != 0; then … … 4049 4037 +fi 4050 4038 + 4051 +$xx -t ïŒ 4039 +$xx -t ïŒ -k4 -n misc/mb2.I > misc/mb2.O 4052 4040 +code=$? 4053 4041 +if test $code != 0; then
Note:
See TracChangeset
for help on using the changeset viewer.