版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1344578
const IfMgrIfAtom* ifa = _rm->iftree().find_interface(ifname);
if (ifa == NULL) {
ZSP_WARN("Got update for interface not in the libfeaclient tree: %s",
ifname.c_str());
return;
}
const IfTreeInterface* ifp = observed_iftree().find_interface(ifname);
if (ifp == NULL) {
ZSP_WARN("Got update for interface not in the FEA tree: %s",
ifname.c_str());
return;
}
需要改成:
const IfMgrIfAtom* ifa = _rm->iftree().find_interface(ifname);
if (ifa == NULL)
{
ZSP_WARN("Got update for interface not in the libfeaclient tree: %s",
ifname.c_str());
return;
}
const IfTreeInterface* ifp = observed_iftree().find_interface(ifname);
if (ifp == NULL)
{
ZSP_WARN("Got update for interface not in the FEA tree: %s",
ifname.c_str());
return;
}
用正则表达式:
:s/\([^ \t].*\){/\1\r{/g
就可以全部替换。
其中
^ \t.*:是把只有空格,TAB的行过滤掉
(^ \t.*):把{前面的内容记录下来
\1\r:在{前面加换行符