- # remember first file name
- if ( ! file )
- file = FILENAME
-
- else if ( file != FILENAME ) { # second and following files
- if ( match( $0, /CONFIG_[A-Za-z0-9_-]+/ ) ) {
- option = substr( $0, RSTART, RLENGTH )
- if ( $0 ~ "^" option "=.+$" || $0 ~ "^# " option " is not set$" ) {
- if ( option in outputArray )
- warn( option " already defined in: " outputArray[ option ] )
- else {
- print
- outputArray[ option ] = FILENAME " (" FNR ")"
- }
- } else {
- if ( ! /^#/ )
- warn( "Incorrect line: " $0 )
- }
- } else if ( ! /^\s*$/ && ! /^#/ ) {
- warn( "Incorrect line: " $0 )
- }
- next