From: Andy G. <ag...@us...> - 2002-11-20 02:13:10
|
Update of /cvsroot/acpi/ospmd/ospmd/ospmd In directory sc8-pr-cvs1:/tmp/cvs-serv20462/ospmd/ospmd Modified Files: properties.cpp Log Message: eliminate trailing spaces a missing config file is not an error, just continue Index: properties.cpp =================================================================== RCS file: /cvsroot/acpi/ospmd/ospmd/ospmd/properties.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- properties.cpp 8 Oct 2002 18:16:39 -0000 1.1.1.1 +++ properties.cpp 20 Nov 2002 02:13:07 -0000 1.2 @@ -24,7 +24,7 @@ break; str++; } - + return str; } @@ -45,7 +45,7 @@ } str[len+1] = '\0'; } - + return str; } @@ -56,13 +56,13 @@ char line[MAX_LINE_SIZE]; char* name; char* value; - + OSPMD_DBG(OSPM_INFO, "Reading from %s\n", filename); if (!(fp = fopen(filename, "r"))) { - OSPMD_ERROR("Could not open %s\n", filename); - return -1; + OSPMD_ERROR("Could not open %s, using defaults\n", filename); + return 0; } while (fgets(line, MAX_LINE_SIZE, fp)) @@ -70,12 +70,12 @@ name = skipchars(line, " \t\n"); if (*name == COMMENT_CHAR || *name == '\0') continue; // skip comment or empty line - + // find assignment value = strchr(line, ASSIGNMENT_CHAR); - *value = '\0'; // isolate strings + *value = '\0'; // isolate strings value++; - + // remove trailing chars name = cropchars(name, CROP_CHARS); value = cropchars(value, CROP_CHARS); @@ -83,7 +83,7 @@ if (strlen(value) > 0 ) set_prop_string(string(name), string(value)); } - + fclose(fp); return 0; |