IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13175


Ignore:
Timestamp:
May 2, 2007, 3:47:11 PM (19 years ago)
Author:
Paul Price
Message:

psMetadataConfigRead should not generate an error for an empty file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadataConfig.c

    r12887 r13175  
    1111*  @author Joshua Hoblitt, University of Hawaii 2006-2007
    1212*
    13 *  @version $Revision: 1.134 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2007-04-18 19:38:36 $
     13*  @version $Revision: 1.135 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2007-05-03 01:47:11 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    777777            return false;
    778778        }
    779        
     779
    780780        // covert the template, and the rest of the line, into a metadata
    781781        tempMeta = parseTypeValues(template, linePtr);
     
    889889        } else {
    890890            psError(PS_ERR_IO, true,
    891                     _("Failed to parse the value '%s' of metadata item %s, type %s."), 
     891                    _("Failed to parse the value '%s' of metadata item %s, type %s."),
    892892                    strValue, keyName, strType);
    893893            returnValue = false;
     
    10441044                break;
    10451045            }
    1046            
     1046
    10471047            // create the nested metadata
    10481048            psMetadata *newScope = psMetadataAlloc();
     
    11091109    }
    11101110
    1111     // even if it's a "bad line" we know it can't be "blank" after this point 
     1111    // even if it's a "bad line" we know it can't be "blank" after this point
    11121112    *notBlank = true;
    11131113
     
    12981298    // bus errors if the file is empty.  This seems like a strange result...
    12991299    if (buf.st_size == 0) {
    1300         psError(PS_ERR_IO, true, _("Empty file '%s'.\n"), filename);
     1300        // We successfully read everything we could.  Return a MD containing what we read.
    13011301        close(fd);
    1302         return NULL;
     1302        return psMetadataAlloc();
    13031303    }
    13041304
     
    14531453            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    14541454                    _("Specified psDataType, %d, is not supported."), PS_DATA_UNKNOWN);
    1455             psTrace("psLib.types", 5, "failed to find key %s\n", (char *) keys->data[i]);
     1455            psTrace("psLib.types", 5, "failed to find key %s\n", (char *) keys->data[i]);
    14561456            psFree(keys);
    14571457            psFree(format);
     
    14611461        if (!str) {
    14621462            psError(PS_ERR_UNKNOWN, false, "failed to format psMetadataItem");
    1463             psTrace("psLib.types", 5, "failed to format %s\n", (char *) keys->data[i]);
     1463            psTrace("psLib.types", 5, "failed to format %s\n", (char *) keys->data[i]);
    14641464            psFree(keys);
    14651465            psFree(format);
Note: See TracChangeset for help on using the changeset viewer.