style cleanup and tab correction; clean up single character vars

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40322 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV
2011-01-30 16:50:27 +00:00
parent 95d84e4176
commit 2ab028f7d4
2 changed files with 25 additions and 21 deletions
@@ -28,6 +28,8 @@ get_nth_addon(image_id image, int index)
// #pragma mark -
ServicesAddOn::ServicesAddOn(image_id image)
:
NetworkSetupAddOn(image)
@@ -51,7 +53,7 @@ ServicesAddOn::CreateView(BRect* bounds)
fServicesListView, B_FOLLOW_ALL_SIDES,
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
if (ParseInetd() == B_ERROR)
if (ParseInetd() != B_OK)
ParseXinetd();
*bounds = r;
@@ -64,12 +66,12 @@ ServicesAddOn::ParseInetd()
{
FILE *f = fopen("/etc/inetd.conf", "r");
if (f) {
char line[1024], *l;
char line[1024], *linePtr;
char *token;
while (fgets(line, sizeof(line), f)) {
l = line;
if (! *l)
linePtr = line;
if (! *linePtr)
continue;
if (line[0] == '#') {
@@ -78,7 +80,7 @@ ServicesAddOn::ParseInetd()
line[1] == '\r')
// skip comments
continue;
l++; // jump the disable/comment service mark
linePtr++; // jump the disable/comment service mark
}
BString label;
@@ -103,19 +105,20 @@ ServicesAddOn::ParseXinetd()
{
FILE *f = fopen("/boot/common/settings/network/services", "r");
if (f) {
char line[1024], *l;
char line[1024], *linePtr;
char *token;
char *loc;
while (fgets(line, sizeof(line), f)) {
l = line;
linePtr = line;
if (! *l)
if (! *linePtr)
continue;
if (line[0] == '#' || line[0] == '\n')
continue;
if (line[0] == '#' || line[0] == '\n') {
// Skip commented out lines
continue;
}
loc = strstr(l, "service ");
@@ -6,6 +6,7 @@
* Alexander von Gluck, [email protected]
*/
#include "NetworkSetupAddOn.h"
class ServicesAddOn : public NetworkSetupAddOn {