Changeset 998


Ignore:
Timestamp:
07/11/20 13:47:06 (4 weeks ago)
Author:
Maciej Komosinski
Message:

Report the error status just once so that while(go()) does not have to always check the error condition to stop (prevents endless loop on permanent errors)

Location:
cpp/frams/param
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/param/multiparamload.cpp

    r973 r998  
    9393{
    9494        SString buf;
    95         if (status == OnError) return status;
     95        if (status == OnError) return getStatusClearError();
    9696        int unexpected_line = 0;
    9797        while (!finished())
     
    202202                }
    203203        }
    204         return status;
     204        return getStatusClearError();
    205205}
    206206
  • cpp/frams/param/multiparamload.h

    r737 r998  
    9090        /** same value as 'go()' */
    9191        int getStatus() { return status; }
     92        int getStatusClearError() { int s = status; if (status & OnError) status &= ~ OnError; return s; }
    9293        int finished() { return (status == Finished); }
    9394
Note: See TracChangeset for help on using the changeset viewer.