diff options
author | Michael Mann <mmann78@netscape.net> | 2017-08-20 13:33:53 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-08-24 05:00:06 +0000 |
commit | 274bbd5fab970c5a2048f9d00bb4e441cd68d04a (patch) | |
tree | c01ecd63a2489fa1175c110fb94b459a126dace5 /tools/make-manuf | |
parent | e624445adff8aa10ca6663e653b13ecd5c7db8d2 (diff) |
Extract the "long name" out of the manuf file and use it for some resolution
Some places (like MAC resolution) want to keep a fixed length, but for places
that want to display "full organization name", save the long name that is
treated as a comment in the manuf file.
Have make-manuf convert companies with all caps to mixed case so we're not
screaming the company name at the user.
Convert the manuf.tmpl to be tab delimited without a comment for the "long name"
so it can match the format now created by make-manuf.
Remove uint_get_manuf_name as it was unnecessary.
Bug: 3666
Change-Id: If2af5a1ce64e2784fe3941eeae8d8093d4f1467b
Reviewed-on: https://code.wireshark.org/review/23150
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools/make-manuf')
-rwxr-xr-x | tools/make-manuf | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/make-manuf b/tools/make-manuf index 081dc2ba27..37fd9c89f1 100755 --- a/tools/make-manuf +++ b/tools/make-manuf @@ -24,6 +24,7 @@ use Encode; use open ':encoding(utf8)'; +use Text::Autoformat; eval "require LWP::UserAgent;"; if( $@ ) { @@ -91,7 +92,16 @@ sub shorten if ($manuf =~ /\Q$origmanuf\E/i) { return $manuf; } else { - return sprintf("%-22s # %s", $manuf, $origmanuf); + my $mixedcase = $origmanuf; + + #If company is all caps, convert to mixed case (so it doesn't look like we're screaming the company name) + if ($origmanuf =~ /^[A-Z\s\.\,]+$/) { + $mixedcase = autoformat $origmanuf, { case => 'title' }; + #autoformat produces some unnecessary linebreaks + chomp($mixedcase); + chomp($mixedcase); + } + return sprintf("%s\t%s", $manuf, $mixedcase); } } |