From: Zoran V. <vas...@us...> - 2005-06-27 17:48:13
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10889/nsd Modified Files: nsmain.c Log Message: Improved clarity of code handling nsconf.home path rewriting for the Windows platform. Index: nsmain.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsmain.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** nsmain.c 24 Jun 2005 08:38:27 -0000 1.14 --- nsmain.c 27 Jun 2005 17:47:57 -0000 1.15 *************** *** 111,115 **** int i, fd, sig, optind, cmdargc; char **cmdargv; ! char *config, *tcp; Ns_Time timeout; --- 111,115 ---- int i, fd, sig, optind, cmdargc; char **cmdargv; ! char *config; Ns_Time timeout; *************** *** 129,132 **** --- 129,133 ---- struct rlimit rl; #else + char *cwd; /* * The following variables are declared static so they *************** *** 591,610 **** * home, ensuring forward slashes and lowercase. */ ! ! tcp = nsconf.home = getcwd(NULL, _MAX_PATH); if (nsconf.home == NULL) { Ns_Fatal("nsmain: getcwd failed: '%s'", strerror(errno)); } ! while (*nsconf.home != '\0') { ! if (*nsconf.home == '\\') { ! *nsconf.home = '/'; ! } else if (isupper(*nsconf.home)) { ! *nsconf.home = tolower(*nsconf.home); } - ++nsconf.home; } ! nsconf.home = tcp; ! /* * Then, connect to the service control manager if running --- 592,608 ---- * home, ensuring forward slashes and lowercase. */ ! nsconf.home = getcwd(NULL, _MAX_PATH); if (nsconf.home == NULL) { Ns_Fatal("nsmain: getcwd failed: '%s'", strerror(errno)); } ! for (cwd = nsconf.home; *cwd != '\0'; cwd++) { ! if (*cwd == '\\') { ! *cwd = '/'; ! } else if (isupper(*cwd)) { ! *cwd = tolower(*cwd); } } ! /* * Then, connect to the service control manager if running |