IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19770


Ignore:
Timestamp:
Sep 26, 2008, 5:49:22 PM (18 years ago)
Author:
mwv
Message:

Included <libgen.h> for systems not using GNU <string.h>
Reformated definition of tempName to properly handle "const char*"
and to handle "basename" that may or may not modify the argument passed.
It's a touch ugly, but it should work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackLoop.c

    r19756 r19770  
    66#include <unistd.h>
    77#include <string.h>
     8#include <libgen.h>
    89#include <pslib.h>
    910#include <psmodules.h>
     
    193194        return false;
    194195    }
    195     const char *tempName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // Name for temporary files
    196     tempName = basename(tempName);
     196
     197    psString outputName = psStringCopy(psMetadataLookupStr(NULL, config->arguments, "OUTPUT")); // Name for temporary files
     198    const char *tempName = basename(outputName);
    197199    if (!tempName) {
    198200        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to construct basename for temporary files.");
     
    393395        weightNames->data[i] = weightName;
    394396    }
     397    // Free the outputName that we grabbed above to set up tempName.
     398    psFree(outputName);
    395399
    396400    // Generate convolutions and write them to disk
Note: See TracChangeset for help on using the changeset viewer.