aboutsummaryrefslogtreecommitdiff
path: root/common/file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/file.cpp')
-rw-r--r--common/file.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/file.cpp b/common/file.cpp
index 6b7b954942..d2abdf75cc 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -269,3 +269,20 @@ uint32 File::write(const void *ptr, uint32 len) {
return len;
}
+
+char *File::gets(void *ptr, uint32 len) {
+ char *ptr2 = (char *)ptr;
+ char *res;
+
+ if (_handle == NULL) {
+ error("File::gets: File is not open!");
+ return 0;
+ }
+
+ if (len == 0)
+ return 0;
+
+ res = fgets(ptr2, len, _handle);
+
+ return res;
+}