summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/windir.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/windir.c')
-rw-r--r--otherlibs/win32unix/windir.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/otherlibs/win32unix/windir.c b/otherlibs/win32unix/windir.c
index 0461c1e34..7009febeb 100644
--- a/otherlibs/win32unix/windir.c
+++ b/otherlibs/win32unix/windir.c
@@ -23,22 +23,21 @@ value win_findfirst(name) /* ML */
int h;
value v;
struct _finddata_t fileinfo;
- Push_roots(r,1);
-
-#define valname r[0]
-
- h = _findfirst(String_val(name),&fileinfo);
- if (h == -1) {
- if (errno == ENOENT)
- raise_end_of_file();
- else
- uerror("opendir", Nothing);
- }
- valname = copy_string(fileinfo.name);
- v = alloc_tuple(2);
- Field(v,0) = valname;
- Field(v,1) = Val_int(h);
- Pop_roots();
+ value valname = Val_unit;
+
+ Begin_root (valname);
+ h = _findfirst(String_val(name),&fileinfo);
+ if (h == -1) {
+ if (errno == ENOENT)
+ raise_end_of_file();
+ else
+ uerror("opendir", Nothing);
+ }
+ valname = copy_string(fileinfo.name);
+ v = alloc_tuple(2);
+ Field(v,0) = valname;
+ Field(v,1) = Val_int(h);
+ End_roots();
return v;
}