Apply to AmberTools release cantidate 2010-03-28 cd $AMBERHOME/src/ptraj patch -p0 -N -r patch_rejects < ptraj.c.singleFrame.patch Author: Daniel R. Roe Date: 2010-03-29 Description: Fixes bug where ptraj would not correctly recognize AMBER trajectories of length 1 without box coordinates. ----------------------------------------------------------------------------- --- ptraj.c 2010-03-29 17:48:28.000000000 -0400 +++ ptraj.c 2010-03-29 17:46:47.000000000 -0400 @@ -2393,15 +2393,16 @@ /* Check for box coordinates. If present, update the frame size and * reallocate the frame buffer. */ - trajFile_fgets(buffer1,BUFFER_SIZE,trajInfo); - if (prnlev>0) fprintf(stdout,"DEBUG: Box Line: (%s)\n",buffer1); - numBoxCoords = sscanf(buffer1, "%f%f%f%f%f%f%f%f%f", - &junk1, &junk2, &junk3, &junk4, &junk5, &junk6, - &junk7, &junk8, &junk9); - if (totalAtoms > 2 && numBoxCoords < 9) { - isBox = 1; - trajInfo->frameSize += (numBoxCoords * 8 + 1); - trajInfo->buffer=(char*) realloc(trajInfo->buffer,(trajInfo->frameSize) * sizeof(char)); + if (trajFile_fgets(buffer1,BUFFER_SIZE,trajInfo)!=NULL) { + if (prnlev>0) fprintf(stdout,"DEBUG: Box Line: (%s)\n",buffer1); + numBoxCoords = sscanf(buffer1, "%f%f%f%f%f%f%f%f%f", + &junk1, &junk2, &junk3, &junk4, &junk5, &junk6, + &junk7, &junk8, &junk9); + if (totalAtoms > 2 && numBoxCoords < 9) { + isBox = 1; + trajInfo->frameSize += (numBoxCoords * 8 + 1); + trajInfo->buffer=(char*) realloc(trajInfo->buffer,(trajInfo->frameSize) * sizeof(char)); + } } /* Calculate number of frames. If not possible this could be a compressed