IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 27, 2007, 12:23:01 PM (19 years ago)
Author:
jhoblitt
Message:

fix pxDataGet()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pxdata.c.template

    r12075 r12091  
    5252        psString text = psSlurpFilename(filepath);
    5353        psFree(filepath);
     54        if (!text) {
     55            psError(PS_ERR_IO, false, "failed to slurp %s", filepath);
     56            return NULL;
     57        }
    5458
    5559        return text;
     
    6165    // see if we have a valid filename
    6266    if (test_f(filepath)) {
    63         // if we don't, then we're hosed
    64         psError(PS_ERR_IO, true, "can't find a file in search path(s) to match : %s", filename);
     67        // if we do, slurp the file
     68        psString text = psSlurpFilename(filepath);
    6569        psFree(filepath);
     70        if (!text) {
     71            psError(PS_ERR_IO, false, "failed to slurp %s", filepath);
     72            return NULL;
     73        }
    6674
    67         return NULL;
     75        return text;
    6876    }
    6977
    70     // slurp the file
    71     psString text = psSlurpFilename(filepath);
    72     psFree(filepath);
    73     if (!text) {
    74         psError(PS_ERR_IO, false, "failed to slurp %s", filepath);
    75         return NULL;
    76     }
     78    // couldn't find a matching filename
     79    psError(PS_ERR_IO, true, "can't find a file in search path(s) to match : %s", filename);
    7780
    78     return text;
     81    return NULL;
    7982}
    8083
Note: See TracChangeset for help on using the changeset viewer.