• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

fermisurfer Git


Commit MetaInfo

Revisionbd6acb96d2a4d9086b9a42ec2f6dce39db527f01 (tree)
Time2022-08-02 18:34:17
AuthorMitsuaki Kawamura <kawamitsuaki@gmai...>
CommiterMitsuaki Kawamura

Log Message

BXSF file was not read correctly when there is lank line.

Change Summary

Incremental Difference

--- a/examples/pb.bxsf
+++ b/examples/pb.bxsf
@@ -9,7 +9,7 @@
99 END_INFO
1010 BEGIN_BLOCK_BANDGRID_3D
1111 band_energies
12- BANDGRID_3D_BANDS
12+ BEGIN_BANDGRID_3D
1313 3
1414 17 17 17
1515 0.000000 0.000000 0.000000
--- a/src/read_file.cpp
+++ b/src/read_file.cpp
@@ -433,9 +433,9 @@ void read_bxsf()
433433 while (strstr(ctmp, "BEGIN_BLOCK_BANDGRID_3D") == NULL) {
434434 cerr = fgets(ctmp, 256, fp);
435435 }
436- cerr = fgets(ctmp, 256, fp);
437- cerr = fgets(ctmp, 256, fp);
438-
436+ while (strstr(ctmp, "BEGIN_BANDGRID_3D") == NULL) {
437+ cerr = fgets(ctmp, 256, fp);
438+ }
439439 cerr = fgets(ctmp, 256, fp);
440440 ierr = sscanf(ctmp, "%d", &nb);
441441 *terminal << wxString::Format(wxT(" Number of bands : %d\n"), nb);
@@ -456,6 +456,9 @@ void read_bxsf()
456456
457457 for (ib = 0; ib < nb; ib++) {
458458 cerr = fgets(ctmp, 256, fp);
459+ while (strstr(ctmp, "BAND:") == NULL) {
460+ cerr = fgets(ctmp, 256, fp);
461+ }
459462 *terminal << wxString::Format(wxT(" Reading %s"), ctmp);
460463
461464 for (i0 = 0; i0 <= ng0[0]; i0++) {