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:
@@ -28,6 +28,8 @@ get_nth_addon(image_id image, int index)
|
|||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
ServicesAddOn::ServicesAddOn(image_id image)
|
ServicesAddOn::ServicesAddOn(image_id image)
|
||||||
:
|
:
|
||||||
NetworkSetupAddOn(image)
|
NetworkSetupAddOn(image)
|
||||||
@@ -51,7 +53,7 @@ ServicesAddOn::CreateView(BRect* bounds)
|
|||||||
fServicesListView, B_FOLLOW_ALL_SIDES,
|
fServicesListView, B_FOLLOW_ALL_SIDES,
|
||||||
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
|
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
|
||||||
|
|
||||||
if (ParseInetd() == B_ERROR)
|
if (ParseInetd() != B_OK)
|
||||||
ParseXinetd();
|
ParseXinetd();
|
||||||
|
|
||||||
*bounds = r;
|
*bounds = r;
|
||||||
@@ -64,12 +66,12 @@ ServicesAddOn::ParseInetd()
|
|||||||
{
|
{
|
||||||
FILE *f = fopen("/etc/inetd.conf", "r");
|
FILE *f = fopen("/etc/inetd.conf", "r");
|
||||||
if (f) {
|
if (f) {
|
||||||
char line[1024], *l;
|
char line[1024], *linePtr;
|
||||||
char *token;
|
char *token;
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), f)) {
|
while (fgets(line, sizeof(line), f)) {
|
||||||
l = line;
|
linePtr = line;
|
||||||
if (! *l)
|
if (! *linePtr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (line[0] == '#') {
|
if (line[0] == '#') {
|
||||||
@@ -78,7 +80,7 @@ ServicesAddOn::ParseInetd()
|
|||||||
line[1] == '\r')
|
line[1] == '\r')
|
||||||
// skip comments
|
// skip comments
|
||||||
continue;
|
continue;
|
||||||
l++; // jump the disable/comment service mark
|
linePtr++; // jump the disable/comment service mark
|
||||||
}
|
}
|
||||||
|
|
||||||
BString label;
|
BString label;
|
||||||
@@ -103,19 +105,20 @@ ServicesAddOn::ParseXinetd()
|
|||||||
{
|
{
|
||||||
FILE *f = fopen("/boot/common/settings/network/services", "r");
|
FILE *f = fopen("/boot/common/settings/network/services", "r");
|
||||||
if (f) {
|
if (f) {
|
||||||
char line[1024], *l;
|
char line[1024], *linePtr;
|
||||||
char *token;
|
char *token;
|
||||||
char *loc;
|
char *loc;
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), f)) {
|
while (fgets(line, sizeof(line), f)) {
|
||||||
l = line;
|
linePtr = line;
|
||||||
|
|
||||||
if (! *l)
|
if (! *linePtr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (line[0] == '#' || line[0] == '\n')
|
if (line[0] == '#' || line[0] == '\n') {
|
||||||
continue;
|
|
||||||
// Skip commented out lines
|
// Skip commented out lines
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
loc = strstr(l, "service ");
|
loc = strstr(l, "service ");
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
* Alexander von Gluck, [email protected]
|
* Alexander von Gluck, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "NetworkSetupAddOn.h"
|
#include "NetworkSetupAddOn.h"
|
||||||
|
|
||||||
class ServicesAddOn : public NetworkSetupAddOn {
|
class ServicesAddOn : public NetworkSetupAddOn {
|
||||||
|
|||||||
Reference in New Issue
Block a user