summaryrefslogtreecommitdiff
path: root/src/PSEditor.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2004-07-20 18:02:07 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2004-07-20 18:02:07 +0000
commit868224c20d2b4a61746b7a7670814ffcf9b93060 (patch)
tree5fb63820817066421766c2b4c2f5bd42287cd499 /src/PSEditor.cxx
parent0394671217f1416353fd5f9f432333a1325ad53e (diff)
restore file position after save.
restore file position after save.
Diffstat (limited to 'src/PSEditor.cxx')
-rw-r--r--src/PSEditor.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/PSEditor.cxx b/src/PSEditor.cxx
index 6e94f9f..352f401 100644
--- a/src/PSEditor.cxx
+++ b/src/PSEditor.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: PSEditor.cxx,v 1.6 2004/07/20 18:53:29 hofmann Exp $"
+// "$Id: PSEditor.cxx,v 1.7 2004/07/20 20:02:07 hofmann Exp $"
//
// PSEditor routines.
//
@@ -149,6 +149,8 @@ int PSEditor::load(char *f) {
}
int PSEditor::save(const char* savefile) {
+ off_t pos = lseek(tmp_fd, 0, SEEK_CUR); // save current position
+
if (!file_loaded()) {
return 1;
}
@@ -168,6 +170,7 @@ int PSEditor::save(const char* savefile) {
delete(pw);
fclose(sfp);
+ lseek(tmp_fd, pos, SEEK_SET); // restore current position
mod = 0;
return 0;
}