|
@@ -4,7 +4,6 @@
|
|
|
#include <string> // for std::string
|
|
#include <string> // for std::string
|
|
|
|
|
|
|
|
#include "hplatform.h" // for stat
|
|
#include "hplatform.h" // for stat
|
|
|
-#include "hdef.h" // for LF, CR
|
|
|
|
|
#include "hbuf.h" // for HBuf
|
|
#include "hbuf.h" // for HBuf
|
|
|
|
|
|
|
|
class HFile {
|
|
class HFile {
|
|
@@ -86,14 +85,14 @@ public:
|
|
|
str.clear();
|
|
str.clear();
|
|
|
char ch;
|
|
char ch;
|
|
|
while (fread(&ch, 1, 1, fp)) {
|
|
while (fread(&ch, 1, 1, fp)) {
|
|
|
- if (ch == LF) {
|
|
|
|
|
|
|
+ if (ch == '\n') {
|
|
|
// unix: LF
|
|
// unix: LF
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
- if (ch == CR) {
|
|
|
|
|
|
|
+ if (ch == '\r') {
|
|
|
// dos: CRLF
|
|
// dos: CRLF
|
|
|
// read LF
|
|
// read LF
|
|
|
- if (fread(&ch, 1, 1, fp) && ch != LF) {
|
|
|
|
|
|
|
+ if (fread(&ch, 1, 1, fp) && ch != '\n') {
|
|
|
// mac: CR
|
|
// mac: CR
|
|
|
fseek(fp, -1, SEEK_CUR);
|
|
fseek(fp, -1, SEEK_CUR);
|
|
|
}
|
|
}
|