update: fix hyphen counting (legacy tap renaming)
update: fix hyphen counting (legacy tap renaming)

Fix regression introduced in b2c31074e786835b45d0d07ca156cd3fb1ce2a9f.
Backported from Homebrew/brew@500f9eada854c1939bf9a0caf94085214c9399b0.
Counting the number of hyphens in a string cannot be done in a single
expression, thus split this and introduce another local variable.

filcab/homebrew,marcwebbie/homebrew,brunchboy/homebrew,booi/homebrew,yumitsu/homebrew,ablyler/homebrew,Homebrew/homebrew,cscetbon/homebrew,gawbul/homebrew,theeternalsw0rd/homebrew,chadcatlett/homebrew,theeternalsw0rd/homebrew,mkrapp/homebrew,3van/homebrew,influxdb/homebrew,yumitsu/homebrew,Homebrew/homebrew,gawbul/homebrew,josa42/homebrew,frodeaa/homebrew,cscetbon/homebrew,chadcatlett/homebrew,Homebrew/homebrew,cscetbon/homebrew,theeternalsw0rd/homebrew,michaKFromParis/homebrew-sparks,booi/homebrew,josa42/homebrew,lrascao/homebrew,marcwebbie/homebrew,deorth/homebrew,deorth/homebrew,filcab/homebrew,joshfriend/homebrew,lrascao/homebrew,marcwebbie/homebrew,josa42/homebrew,filcab/homebrew,influxdata/homebrew,michaKFromParis/homebrew-sparks,michaKFromParis/homebrew-sparks,influxdata/homebrew,influxdb/homebrew,deorth/homebrew,3van/homebrew,influxdata/homebrew,brunchboy/homebrew,frodeaa/homebrew,brunchboy/homebrew,yumitsu/homebrew,ablyler/homebrew,marcwebbie/homebrew,booi/homebrew,influxdata/homebrew,joshfriend/homebrew,gawbul/homebrew,lrascao/homebrew,ablyler/homebrew,3van/homebrew,ablyler/homebrew,chadcatlett/homebrew,mkrapp/homebrew,3van/homebrew,joshfriend/homebrew,frodeaa/homebrew,Homebrew/homebrew,frodeaa/homebrew,mkrapp/homebrew,theeternalsw0rd/homebrew,brunchboy/homebrew,influxdb/homebrew,filcab/homebrew,influxdb/homebrew