/* Free all the lines in FileBuffer Fields affected: Lines CurrentLine NumLines ListHead */
EFI_STATUS FileBufferFreeLines(VOID)
/* Free all the lines in FileBuffer Fields affected: Lines CurrentLine NumLines ListHead */
EFI_STATUS FileBufferFreeLines(VOID)
{
  LIST_ENTRY       *Link;
  EFI_EDITOR_LINE  *Line;
  if (FileBuffer.Lines != NULL) {
    Line = FileBuffer.Lines;
    Link = &(Line->Link);
    do {
      Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
      Link = Link->ForwardLink;
      LineFree (Line);
    } while (Link != FileBuffer.ListHead);
  }
  FileBuffer.Lines       = NULL;
  FileBuffer.CurrentLine = NULL;
  FileBuffer.NumLines    = 0;
  FileBuffer.ListHead->ForwardLink = FileBuffer.ListHead;
  FileBuffer.ListHead->BackLink    = FileBuffer.ListHead;
  return EFI_SUCCESS;
}