IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11041


Ignore:
Timestamp:
Jan 11, 2007, 12:55:36 PM (19 years ago)
Author:
Paul Price
Message:

Cleaning up pmConfigConvertFilename.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfig.c

    r10993 r11041  
    44 *  @author EAM (IfA)
    55 *
    6  *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-01-09 03:57:58 $
     6 *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2007-01-11 22:55:36 $
    88 *
    99 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    10471047
    10481048// convert the supplied name, create a new output psString
    1049 psString pmConfigConvertFilename (char *filename, pmConfig *config)
    1050 {
     1049psString pmConfigConvertFilename(const char *filename, const pmConfig *config)
     1050{
     1051    PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
     1052    PS_ASSERT_PTR_NON_NULL(config, NULL);
    10511053
    10521054    psString newName = psStringCopy (filename);
     
    10651067    // replace path://PATH with matched datapath
    10661068    if (!strncasecmp (newName, "path://", strlen("path://"))) {
     1069        PS_ASSERT_METADATA_NON_NULL(config->site, NULL);
     1070
    10671071        // filename should be of the form: path://PATH/rest/of/file
    10681072        // replace PATH with matching name from config->site:DATAPATH
     
    10851089        char *realpath = psMetadataLookupStr (NULL, datapath, path);
    10861090        if (realpath == NULL) {
    1087             psError(PS_ERR_UNKNOWN, true, "path (%s) not defined in config.site:DATAPATH for PATH-style name %s", path, newName);
    1088             psFree (newName);
    1089             psFree (path);
     1091            psError(PS_ERR_UNKNOWN, true,
     1092                    "path (%s) not defined in config.site:DATAPATH for PATH-style name %s",
     1093                    path, newName);
     1094            psFree(newName);
     1095            psFree(path);
    10901096            return false;
    10911097        }
    1092         psFree (path);
     1098        psFree(path);
    10931099
    10941100        char *tmpName = NULL;
    1095         psStringAppend (&tmpName, "%s/%s", realpath, mark + 1);
    1096         psFree (newName);
     1101        psStringAppend(&tmpName, "%s/%s", realpath, mark + 1);
     1102        psFree(newName);
    10971103        newName = tmpName;
    10981104    }
Note: See TracChangeset for help on using the changeset viewer.