From 5f3900e07e7e54ac0ceb8628a3f8a16c71e0ae60 Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Wed, 2 Mar 2011 11:10:23 -0800 Subject: [PATCH] better regexp to match /etc/hosts lines with multiple names --- src/libgui/importAddressListWizard/HostsFile.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libgui/importAddressListWizard/HostsFile.cpp b/src/libgui/importAddressListWizard/HostsFile.cpp index 8865c123b..599e62aab 100644 --- a/src/libgui/importAddressListWizard/HostsFile.cpp +++ b/src/libgui/importAddressListWizard/HostsFile.cpp @@ -2,9 +2,9 @@ Firewall Builder - Copyright (C) 2001 NetCitadel, LLC + Copyright (C) 2011 NetCitadel, LLC - Author: Vadim Zaliva lord@crocodile.org + Author: Vadim Kurland vadim@fwbuilder.org This program is free software which we release under the GNU General Public License. You may redistribute and/or modify this program under the terms @@ -44,7 +44,7 @@ void HostsFile::parse() throw(FWException) data.clear(); QRegExp comment("^\\s*#"); - QRegExp hosts_line("(\\S+)\\s+(.*)$"); + QRegExp hosts_line("^\\s*(\\S+)\\s+(\\S*)"); while ( ! file.atEnd()) { @@ -60,8 +60,7 @@ void HostsFile::parse() throw(FWException) if (fwbdebug) qDebug() << "cap(1)=" << hosts_line.cap(1) - << "cap(2)=" << hosts_line.cap(2) - << "cap(3)=" << hosts_line.cap(3); + << "cap(2)=" << hosts_line.cap(2); try {