Fixed an endless loop when iterating over all hosts (when there was no

/etc/hosts file).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23660 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-01-20 12:10:41 +00:00
parent 60db426624
commit 478ebbd14a
+3 -4
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2007, Haiku, Inc. All Rights Reserved. * Copyright 2007-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -336,12 +336,11 @@ ho_next(struct irs_ho *this) {
if (init(this) == -1) if (init(this) == -1)
return (NULL); return (NULL);
if (pvt->index > 0)
return (NULL);
if (!pvt->fp) if (!pvt->fp)
ho_rewind(this); ho_rewind(this);
if (!pvt->fp) { if (!pvt->fp) {
if (pvt->index > 0)
return (NULL);
strcpy(pvt->hostbuf, "localhost"); strcpy(pvt->hostbuf, "localhost");
pvt->host_aliases[0] = NULL; pvt->host_aliases[0] = NULL;
pvt->h_addr_ptrs[0] = (char *)pvt->host_addr; pvt->h_addr_ptrs[0] = (char *)pvt->host_addr;