[doc] create-mime.conf.pl improve case handling

make create-mime.conf.pl more resilient to questionable edits
to /etc/mime.types

non-vnd.* subtype takes precedence over vnd.* subtype
  (type/subtype, e.g. text/plain)

x-ref:
  "lighttpd: does not start with media-types 1.1.0"
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979232
master
Glenn Strauss 2 years ago
parent 65521537a8
commit 35675284a2

@ -120,15 +120,13 @@ sub add {
}
# non-vnd.* subtype wins over vnd.* subtype
if ($type eq $have_type) {
my $have_vnd = ($have_subtype =~ /^vnd\./);
if (($subtype =~ /^vnd\./) ^ $have_vnd) {
if ($have_vnd) {
return set @_; # overwrite
}
else {
return; # ignore
}
my $have_vnd = ($have_subtype =~ /^vnd\./);
if (($subtype =~ /^vnd\./) ^ $have_vnd) {
if ($have_vnd) {
return set @_; # overwrite
}
else {
return; # ignore
}
}

Loading…
Cancel
Save