From: Andrew M. <fit...@us...> - 2007-05-31 15:22:30
|
Update of /cvsroot/radmind/radmind In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3196 Modified Files: ktcheck.c Log Message: Fix: Bug 1728520: ktcheck -C does not work with -K. Added support in -C for minus lines in command files. Index: ktcheck.c =================================================================== RCS file: /cvsroot/radmind/radmind/ktcheck.c,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** ktcheck.c 30 May 2007 18:11:49 -0000 1.120 --- ktcheck.c 31 May 2007 15:22:26 -0000 1.121 *************** *** 103,108 **** } ! /* skip comments and special lines */ ! if ( *buf == '#' || *buf == 's' ) { continue; } --- 103,108 ---- } ! /* skip comments, special and minus lines */ ! if ( *buf == '#' || *buf == 's' || *buf == '-' ) { continue; } *************** *** 112,119 **** } ! if ( snprintf( path, MAXPATHLEN, "%s/client/%s", ! radmind_path, tav[ 1 ] ) >= MAXPATHLEN ) { ! fprintf( stderr, "%s/client/%s: path too long\n", ! radmind_path, tav[ 1 ] ); fclose( kf ); exit( 2 ); --- 112,119 ---- } ! if ( snprintf( path, MAXPATHLEN, "%s%s", ! kdir, tav[ 1 ] ) >= MAXPATHLEN ) { ! fprintf( stderr, "%s%s: path too long\n", ! kdir, tav[ 1 ] ); fclose( kf ); exit( 2 ); *************** *** 159,167 **** } ! /* also skip the base command file */ ! if ( strcmp( fsitem, base_kfile ) == 0 ) { continue; } new = ll_allocate( fsitem ); ll_insert( &head, new ); --- 159,174 ---- } ! /* ! * also skip the base command file. second case ! * handles "-K kfile.K", where kfile path is ! * same as "./kfile.K", but is passed as "kfile.K" ! */ ! if ( strcmp( fsitem, base_kfile ) == 0 || ! ( strncmp( kdir, path, strlen( path )) == 0 ! && strcmp( base_kfile, de->d_name )) == 0 ) { continue; } + new = ll_allocate( fsitem ); ll_insert( &head, new ); *************** *** 218,228 **** struct llist *khead = NULL; struct node *node; ! char clientdir[ MAXPATHLEN ]; ! ! if ( snprintf( clientdir, MAXPATHLEN, "%s/client", radmind_path ) ! >= MAXPATHLEN ) { ! fprintf( stderr, "%s/client: path too long\n", radmind_path ); ! return( -1 ); ! } expand_kfile( &khead, base_kfile ); --- 225,230 ---- struct llist *khead = NULL; struct node *node; ! char dir[ MAXPATHLEN ]; ! char *p; expand_kfile( &khead, base_kfile ); *************** *** 232,236 **** } ! cleandirs( clientdir, khead ); ll_free( khead ); --- 234,247 ---- } ! /* ! * can't pass in kdir, since it has a trailing slash. ! * bounds checking done when creating kdir in main(). ! */ ! strcpy( dir, kdir ); ! if (( p = strrchr( dir, '/' )) != NULL ) { ! *p = '\0'; ! } ! ! cleandirs( dir, khead ); ll_free( khead ); *************** *** 549,553 **** while (( c = getopt( argc, argv, "Cc:D:h:iK:np:qrvVw:x:y:z:Z:" )) != EOF ) { switch( c ) { ! case 'C': /* clean up _RADMIND_PATH/client */ clean = 1; break; --- 560,564 ---- while (( c = getopt( argc, argv, "Cc:D:h:iK:np:qrvVw:x:y:z:Z:" )) != EOF ) { switch( c ) { ! case 'C': /* clean up dir containing command.K */ clean = 1; break; |