Check-in [4e6097bf48]
Overview
Comment:Updated to emit correct code for an empty mime types file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4e6097bf48b0a08db9c8289dcacae933a1791ca6
User & Date: rkeene on 2014-02-08 03:15:26
Other Links: manifest | tags
Context
2014-02-08
03:16
Moved cleanup of mime types file to distclean check-in: c928347a46 user: rkeene tags: trunk
03:15
Updated to emit correct code for an empty mime types file check-in: 4e6097bf48 user: rkeene tags: trunk
03:14
Updated to make mime types file configurable check-in: ad6e43c2bd user: rkeene tags: trunk
Changes

Modified generate-mime-types from [ce8a54e188] to [64211e4a81].

    77     77   	set hash_id [filed_hash $extension $modulus]
    78     78   
    79     79   	lappend hashinfo($hash_id) $extension
    80     80   
    81     81   }
    82     82   
    83     83   # Emit a C fragment to take a pointer (p) to an extension determine the mime type
    84         -puts "\tswitch (filed_hash((const unsigned char *) p, $modulus)) \{"
    85         -foreach hash [lsort -integer -increasing [array names hashinfo]] {
    86         -	puts "\t\tcase $hash:"
    87         -	foreach extension $hashinfo($hash) {
    88         -		puts "\t\t\tif (strcmp(p, \"$extension\") == 0) \{"
    89         -		puts "\t\t\t\treturn(\"$extensioninfo($extension)\");"
    90         -		puts "\t\t\t\}"
           84  +if {[llength [array names hashinfo]] > 0} {
           85  +	puts "\tswitch (filed_hash((const unsigned char *) p, $modulus)) \{"
           86  +	foreach hash [lsort -integer -increasing [array names hashinfo]] {
           87  +		puts "\t\tcase $hash:"
           88  +		foreach extension $hashinfo($hash) {
           89  +			puts "\t\t\tif (strcmp(p, \"$extension\") == 0) \{"
           90  +			puts "\t\t\t\treturn(\"$extensioninfo($extension)\");"
           91  +			puts "\t\t\t\}"
           92  +		}
           93  +		puts "\t\t\treturn(FILED_DEFAULT_TYPE);"
    91     94   	}
    92         -	puts "\t\t\treturn(FILED_DEFAULT_TYPE);"
           95  +	puts "\t\}"
    93     96   }
    94         -puts "\t\}"
    95     97   
    96     98   # Declare victory
    97     99   exit 0