Sun Dec 13 23:25:40 2009 UTC ()
(unsigned char) for ctype functions.


(christos)
diff -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libopts/makeshell.c
diff -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libopts/version.c

cvs diff -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libopts/Attic/makeshell.c (expand / switch to unified diff)

--- src/external/bsd/ntp/dist/libopts/Attic/makeshell.c 2009/12/13 16:55:08 1.1.1.1
+++ src/external/bsd/ntp/dist/libopts/Attic/makeshell.c 2009/12/13 23:25:40 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: makeshell.c,v 1.1.1.1 2009/12/13 16:55:08 kardel Exp $ */ 1/* $NetBSD: makeshell.c,v 1.2 2009/12/13 23:25:40 christos Exp $ */
2 2
3 3
4/* 4/*
5 * Id: 7226344c6486a4eda395f893881080b7d80a2003 5 * Id: 7226344c6486a4eda395f893881080b7d80a2003
6 * Time-stamp: "2009-11-01 11:52:37 bkorb" 6 * Time-stamp: "2009-11-01 11:52:37 bkorb"
7 * 7 *
8 * This module will interpret the options set in the tOptions 8 * This module will interpret the options set in the tOptions
9 * structure and create a Bourne shell script capable of parsing them. 9 * structure and create a Bourne shell script capable of parsing them.
10 * 10 *
11 * This file is part of AutoOpts, a companion to AutoGen. 11 * This file is part of AutoOpts, a companion to AutoGen.
12 * AutoOpts is free software. 12 * AutoOpts is free software.
13 * AutoOpts is copyright (c) 1992-2009 by Bruce Korb - all rights reserved 13 * AutoOpts is copyright (c) 1992-2009 by Bruce Korb - all rights reserved
14 * 14 *
@@ -607,27 +607,27 @@ emitUsage( tOptions* pOpts ) @@ -607,27 +607,27 @@ emitUsage( tOptions* pOpts )
607 if ((pzLeader == NULL) && (pzShell != NULL)) 607 if ((pzLeader == NULL) && (pzShell != NULL))
608 printf( "#! %s\n", pzShell ); 608 printf( "#! %s\n", pzShell );
609 609
610 printf( zPreamble, zStartMarker, pzOutName, zTimeBuf ); 610 printf( zPreamble, zStartMarker, pzOutName, zTimeBuf );
611 } 611 }
612 612
613 /* 613 /*
614 * Get a copy of the original program name in lower case 614 * Get a copy of the original program name in lower case
615 */ 615 */
616 { 616 {
617 char* pzPN = zTimeBuf; 617 char* pzPN = zTimeBuf;
618 tCC* pz = pOpts->pzPROGNAME; 618 tCC* pz = pOpts->pzPROGNAME;
619 for (;;) { 619 for (;;) {
620 if ((*pzPN++ = tolower( *pz++ )) == '\0') 620 if ((*pzPN++ = tolower( (unsigned char)*pz++ )) == '\0')
621 break; 621 break;
622 } 622 }
623 } 623 }
624 624
625 printf( zEndPreamble, pOpts->pzPROGNAME ); 625 printf( zEndPreamble, pOpts->pzPROGNAME );
626 626
627 pOpts->pzProgPath = pOpts->pzProgName = zTimeBuf; 627 pOpts->pzProgPath = pOpts->pzProgName = zTimeBuf;
628 textToVariable( pOpts, TT_LONGUSAGE, NULL ); 628 textToVariable( pOpts, TT_LONGUSAGE, NULL );
629 textToVariable( pOpts, TT_USAGE, NULL ); 629 textToVariable( pOpts, TT_USAGE, NULL );
630 630
631 { 631 {
632 tOptDesc* pOptDesc = pOpts->pOptDesc; 632 tOptDesc* pOptDesc = pOpts->pOptDesc;
633 int optionCt = pOpts->optCt; 633 int optionCt = pOpts->optCt;
@@ -823,40 +823,40 @@ emitMatchExpr( tCC* pzMatchName, tOptDes @@ -823,40 +823,40 @@ emitMatchExpr( tCC* pzMatchName, tOptDes
823 */ 823 */
824 if ((pOD == pCurOpt) || SKIP_OPT(pOD)){ 824 if ((pOD == pCurOpt) || SKIP_OPT(pOD)){
825 if (--oCt <= 0) 825 if (--oCt <= 0)
826 break; 826 break;
827 pOD++; 827 pOD++;
828 continue; 828 continue;
829 } 829 }
830 830
831 /* 831 /*
832 * Check each character of the name case insensitively. 832 * Check each character of the name case insensitively.
833 * They must not be the same. They cannot be, because it would 833 * They must not be the same. They cannot be, because it would
834 * not compile correctly if they were. 834 * not compile correctly if they were.
835 */ 835 */
836 while ( toupper( pOD->pz_Name[matchCt] ) 836 while ( toupper( (unsigned char)pOD->pz_Name[matchCt] )
837 == toupper( pzMatchName[matchCt] )) 837 == toupper( (unsigned char)pzMatchName[matchCt] ))
838 matchCt++; 838 matchCt++;
839 839
840 if (matchCt > min) 840 if (matchCt > min)
841 min = matchCt; 841 min = matchCt;
842 842
843 /* 843 /*
844 * Check the disablement name, too. 844 * Check the disablement name, too.
845 */ 845 */
846 if (pOD->pz_DisableName != NULL) { 846 if (pOD->pz_DisableName != NULL) {
847 matchCt = 0; 847 matchCt = 0;
848 while ( toupper( pOD->pz_DisableName[matchCt] ) 848 while ( toupper( (unsigned char)pOD->pz_DisableName[matchCt] )
849 == toupper( pzMatchName[matchCt] )) 849 == toupper( (unsigned char)pzMatchName[matchCt] ))
850 matchCt++; 850 matchCt++;
851 if (matchCt > min) 851 if (matchCt > min)
852 min = matchCt; 852 min = matchCt;
853 } 853 }
854 if (--oCt <= 0) 854 if (--oCt <= 0)
855 break; 855 break;
856 pOD++; 856 pOD++;
857 } 857 }
858 858
859 /* 859 /*
860 * IF the 'min' is all or one short of the name length, 860 * IF the 'min' is all or one short of the name length,
861 * THEN the entire string must be matched. 861 * THEN the entire string must be matched.
862 */ 862 */
@@ -1050,27 +1050,27 @@ genshelloptUsage( tOptions* pOpts, int  @@ -1050,27 +1050,27 @@ genshelloptUsage( tOptions* pOpts, int
1050 wait( &sts ); 1050 wait( &sts );
1051 } 1051 }
1052 } 1052 }
1053 1053
1054 /* 1054 /*
1055 * Generate the pzProgName, since optionProcess() normally 1055 * Generate the pzProgName, since optionProcess() normally
1056 * gets it from the command line 1056 * gets it from the command line
1057 */ 1057 */
1058 { 1058 {
1059 char* pz; 1059 char* pz;
1060 AGDUPSTR( pz, pShellParseOptions->pzPROGNAME, "program name" ); 1060 AGDUPSTR( pz, pShellParseOptions->pzPROGNAME, "program name" );
1061 pShellParseOptions->pzProgName = pz; 1061 pShellParseOptions->pzProgName = pz;
1062 while (*pz != NUL) { 1062 while (*pz != NUL) {
1063 *pz = tolower( *pz ); 1063 *pz = tolower( (unsigned char)*pz );
1064 pz++; 1064 pz++;
1065 } 1065 }
1066 } 1066 }
1067 1067
1068 /* 1068 /*
1069 * Separate the makeshell usage from the client usage 1069 * Separate the makeshell usage from the client usage
1070 */ 1070 */
1071 fprintf( option_usage_fp, zGenshell, pShellParseOptions->pzProgName ); 1071 fprintf( option_usage_fp, zGenshell, pShellParseOptions->pzProgName );
1072 fflush( option_usage_fp ); 1072 fflush( option_usage_fp );
1073 1073
1074 /* 1074 /*
1075 * Now, print the client usage. 1075 * Now, print the client usage.
1076 */ 1076 */

cvs diff -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libopts/Attic/version.c (expand / switch to unified diff)

--- src/external/bsd/ntp/dist/libopts/Attic/version.c 2009/12/13 16:55:15 1.1.1.1
+++ src/external/bsd/ntp/dist/libopts/Attic/version.c 2009/12/13 23:25:40 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: version.c,v 1.1.1.1 2009/12/13 16:55:15 kardel Exp $ */ 1/* $NetBSD: version.c,v 1.2 2009/12/13 23:25:40 christos Exp $ */
2 2
3 3
4/* Id: e21e2bf9958c54e440efbdc7c1026e46ac589f66 4/* Id: e21e2bf9958c54e440efbdc7c1026e46ac589f66
5 * Time-stamp: "2008-07-27 10:11:30 bkorb" 5 * Time-stamp: "2008-07-27 10:11:30 bkorb"
6 * 6 *
7 * This module implements the default usage procedure for 7 * This module implements the default usage procedure for
8 * Automated Options. It may be overridden, of course. 8 * Automated Options. It may be overridden, of course.
9 */ 9 */
10 10
11/* 11/*
12 * This file is part of AutoOpts, a companion to AutoGen. 12 * This file is part of AutoOpts, a companion to AutoGen.
13 * AutoOpts is free software. 13 * AutoOpts is free software.
14 * AutoOpts is copyright (c) 1992-2009 by Bruce Korb - all rights reserved 14 * AutoOpts is copyright (c) 1992-2009 by Bruce Korb - all rights reserved
@@ -57,27 +57,27 @@ optionVersion( void ) @@ -57,27 +57,27 @@ optionVersion( void )
57 57
58static void 58static void
59printVersion( tOptions* pOpts, tOptDesc* pOD, FILE* fp ) 59printVersion( tOptions* pOpts, tOptDesc* pOD, FILE* fp )
60{ 60{
61 char swCh; 61 char swCh;
62 62
63 /* 63 /*
64 * IF the optional argument flag is off, or the argument is not provided, 64 * IF the optional argument flag is off, or the argument is not provided,
65 * then just print the version. 65 * then just print the version.
66 */ 66 */
67 if ( ((pOD->fOptState & OPTST_ARG_OPTIONAL) == 0) 67 if ( ((pOD->fOptState & OPTST_ARG_OPTIONAL) == 0)
68 || (pOD->optArg.argString == NULL)) 68 || (pOD->optArg.argString == NULL))
69 swCh = 'v'; 69 swCh = 'v';
70 else swCh = tolower(pOD->optArg.argString[0]); 70 else swCh = tolower((unsigned char)pOD->optArg.argString[0]);
71 71
72 if (pOpts->pzFullVersion != NULL) { 72 if (pOpts->pzFullVersion != NULL) {
73 fputs( pOpts->pzFullVersion, fp ); 73 fputs( pOpts->pzFullVersion, fp );
74 fputc( '\n', fp ); 74 fputc( '\n', fp );
75 75
76 } else { 76 } else {
77 char const *pz = pOpts->pzUsageTitle; 77 char const *pz = pOpts->pzUsageTitle;
78 do { fputc(*pz, fp); } while (*(pz++) != '\n'); 78 do { fputc(*pz, fp); } while (*(pz++) != '\n');
79 } 79 }
80 80
81 switch (swCh) { 81 switch (swCh) {
82 case NUL: /* arg provided, but empty */ 82 case NUL: /* arg provided, but empty */
83 case 'v': 83 case 'v':