Diffstat (limited to 'noncore/apps/opie-reader/ztxt.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ztxt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/ztxt.cpp b/noncore/apps/opie-reader/ztxt.cpp index 35db05e..e04eaa0 100644 --- a/noncore/apps/opie-reader/ztxt.cpp +++ b/noncore/apps/opie-reader/ztxt.cpp | |||
@@ -64,12 +64,13 @@ unsigned int ztxt::locate() | |||
64 | 64 | ||
65 | void ztxt::locate(unsigned int n) | 65 | void ztxt::locate(unsigned int n) |
66 | { | 66 | { |
67 | 67 | ||
68 | if (hasrandomaccess()) | 68 | if (hasrandomaccess()) |
69 | { | 69 | { |
70 | unsuspend(); | ||
70 | bufferrec = n / ntohs(hdr0.recordSize) + 1; | 71 | bufferrec = n / ntohs(hdr0.recordSize) + 1; |
71 | if (bufferrec == 1) | 72 | if (bufferrec == 1) |
72 | { | 73 | { |
73 | inflateEnd(&zstream); | 74 | inflateEnd(&zstream); |
74 | } | 75 | } |
75 | size_t reclen = recordlength(bufferrec); | 76 | size_t reclen = recordlength(bufferrec); |
@@ -104,12 +105,13 @@ void ztxt::locate(unsigned int n) | |||
104 | while (currentpos < n && getch() != EOF); | 105 | while (currentpos < n && getch() != EOF); |
105 | } | 106 | } |
106 | } | 107 | } |
107 | 108 | ||
108 | void ztxt::home() | 109 | void ztxt::home() |
109 | { | 110 | { |
111 | unsuspend(); | ||
110 | if (bInit) | 112 | if (bInit) |
111 | { | 113 | { |
112 | inflateEnd(&zstream); | 114 | inflateEnd(&zstream); |
113 | } | 115 | } |
114 | bInit = true; | 116 | bInit = true; |
115 | size_t reclen = recordlength(1); | 117 | size_t reclen = recordlength(1); |
@@ -144,12 +146,13 @@ CList<Bkmk>* ztxt::getbkmklist() | |||
144 | 146 | ||
145 | // printf("Bookmarks - record %d contains %d\n", recno, ntohs(hdr0.numBookmarks)); | 147 | // printf("Bookmarks - record %d contains %d\n", recno, ntohs(hdr0.numBookmarks)); |
146 | 148 | ||
147 | if (recno == 0) return NULL; | 149 | if (recno == 0) return NULL; |
148 | 150 | ||
149 | CList<Bkmk>* t = new CList<Bkmk>; | 151 | CList<Bkmk>* t = new CList<Bkmk>; |
152 | unsuspend(); | ||
150 | size_t cur = ftell(fin); | 153 | size_t cur = ftell(fin); |
151 | gotorecordnumber(recno); | 154 | gotorecordnumber(recno); |
152 | for (int i = 0; i < ntohs(hdr0.numBookmarks); i++) | 155 | for (int i = 0; i < ntohs(hdr0.numBookmarks); i++) |
153 | { | 156 | { |
154 | zTXTbkmk bkmk; | 157 | zTXTbkmk bkmk; |
155 | if (fread(&bkmk, sizeof(bkmk), 1, fin) != 1) break; | 158 | if (fread(&bkmk, sizeof(bkmk), 1, fin) != 1) break; |