IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 11, 2026, 3:21:02 PM (2 months ago)
Author:
eugene
Message:

stiffle excess warnings; plug mem leaks; allow pmConfig to understand file:// (like pmConfigConvertFilename)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-pstamp-20260421/psModules/src/config/pmConfig.c

    r42283 r43018  
    19711971}
    19721972
     1973// this function is similar to pmConfigConvertFilename, but that function requires the ipprc to have
     1974// already been read (since it translates path: entries)
     1975// XXX EAM : merge duplicate code here
    19731976static psString resolveConfigFile(const char *nameArg)
    19741977{
     1978    // strip file:// from front of name
     1979    if (!strncasecmp(nameArg, "file:", strlen("file:"))) {
     1980        psString newName = psStringCopy(nameArg);
     1981
     1982        char *point = newName + strlen("file:");
     1983        while (*point == '/') {
     1984            point ++;
     1985        }
     1986        char *tmpName = NULL;
     1987        psStringAppend (&tmpName, "/%s", point);
     1988        psFree (newName);
     1989        newName = tmpName;
     1990
     1991        if (!checkPath(newName, false, false)) {
     1992            // let checkPath()'s psError() call float up
     1993            psError(psErrorCodeLast(), false, "error from checkPath for file:// (%s)", newName);
     1994            psFree (newName);
     1995            return NULL;
     1996        }
     1997        return newName;
     1998    }
     1999
    19752000    // if config file name is nebulous path resolve it
    19762001    // otherwise just return a copy of the argument
Note: See TracChangeset for help on using the changeset viewer.