@@ -229,11 +229,13 @@ break; case LC_VAR_TIME: case LC_VAR_DATE: case LC_VAR_FILENAME: case LC_VAR_DIRECTORY: - PRINTERR_D("Not implemented yet!"); +#ifdef DEBUG + fprintf(stderr, "Not implemented yet!\n"); +#endif return(-1); case LC_VAR_NONE: case LC_VAR_UNKNOWN: case LC_VAR_SECTION: case LC_VAR_SECTIONSTART: @@ -252,11 +254,11 @@ if (var != NULL) { localvar = strrchr(var, '.'); if (localvar == NULL) { localvar = var; } else { - *localvar++; + localvar++; } } else { localvar = NULL; } @@ -298,17 +300,17 @@ ucase_appname = strdup(appname); if (ucase_appname == NULL) { lc_errno = LC_ERR_ENOMEM; return(-1); } - for (ucase_appname_itr = ucase_appname; *ucase_appname_itr != '\0'; *ucase_appname_itr++) { + for (ucase_appname_itr = ucase_appname; *ucase_appname_itr != '\0'; ucase_appname_itr++) { *ucase_appname_itr = toupper(*ucase_appname_itr); } appnamelen = strlen(ucase_appname); - for (currvar = environ; *currvar != NULL; *currvar++) { + for (currvar = environ; *currvar != NULL; currvar++) { /* If it doesn't begin with our appname ignore it completely. */ if (strncmp(*currvar, ucase_appname, appnamelen) != 0) { continue; } @@ -367,11 +369,11 @@ if (handler->var[0] == '*' && handler->var[1] == '.') { lastcomponent_handler = strrchr(handler->var, '.'); if (lastcomponent_handler == NULL) { lastcomponent_handler = handler->var; } else { - *lastcomponent_handler++; + lastcomponent_handler++; } } else { lastcomponent_handler = handler->var; } @@ -444,15 +446,15 @@ /* Setup a pointer in the new array for the actual argument. */ newargv[newargvidx++] = cmdarg; usedargv[cmdargidx] = 1; /* Then shift the argument past the '-' so we can ignore it. */ - *cmdarg++; + cmdarg++; /* Handle long options. */ if (cmdarg[0] == '-') { - *cmdarg++; + cmdarg++; /* Don't process arguments after the '--' option. */ if (cmdarg[0] == '\0') { break; } @@ -477,11 +479,11 @@ if (handler->var[0] == '*' && handler->var[1] == '.') { lastcomponent_handler = strrchr(handler->var, '.'); if (lastcomponent_handler == NULL) { lastcomponent_handler = handler->var; } else { - *lastcomponent_handler++; + lastcomponent_handler++; } } else { /* Disallow use of the fully qualified name since there was no sectionstart portion we cannot allow it to handle children of it. */ @@ -499,11 +501,11 @@ if (handler->type == LC_VAR_NONE || handler->type == LC_VAR_BOOL_BY_EXISTANCE) { cmdoptarg = NULL; } else { cmdargidx++; if (cmdargidx >= argc) { - PRINTERR("Argument required."); + fprintf(stderr, "Argument required.\n"); lc_errno = LC_ERR_BADFORMAT; free(usedargv); free(newargv); return(-1); } @@ -519,18 +521,18 @@ break; } if (handler == NULL) { - PRINTERR("Unknown option: --%s", cmdarg); + fprintf(stderr, "Unknown option: --%s\n", cmdarg); lc_errno = LC_ERR_INVCMD; free(usedargv); free(newargv); return(-1); } } else { - for (; *cmdarg != '\0'; *cmdarg++) { + for (; *cmdarg != '\0'; cmdarg++) { ch = *cmdarg; for (handler = varhandlers; handler != NULL; handler = handler->_next) { if (handler->opt != ch || handler->opt == '\0') { continue; @@ -547,11 +549,11 @@ if (handler->type == LC_VAR_NONE || handler->type == LC_VAR_BOOL_BY_EXISTANCE) { cmdoptarg = NULL; } else { cmdargidx++; if (cmdargidx >= argc) { - PRINTERR("Argument required."); + fprintf(stderr, "Argument required.\n"); lc_errno = LC_ERR_BADFORMAT; free(usedargv); free(newargv); return(-1); } @@ -567,11 +569,11 @@ break; } if (handler == NULL) { - PRINTERR("Unknown option: -%c", ch); + fprintf(stderr, "Unknown option: -%c\n", ch); lc_errno = LC_ERR_INVCMD; free(usedargv); free(newargv); return(-1); } @@ -608,11 +610,11 @@ lastcomponent_var = strrchr(var, '.'); if (lastcomponent_var == NULL) { lastcomponent_var = var; } else { - *lastcomponent_var++; + lastcomponent_var++; } for (handler = varhandlers; handler != NULL; handler = handler->_next) { /* If either handler->var or var is NULL, skip, unless both are NULL. */ if (handler->var != var && (handler->var == NULL || var == NULL)) {