summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/vms/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/cvs/vms/stat.c')
-rw-r--r--gnu/usr.bin/cvs/vms/stat.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gnu/usr.bin/cvs/vms/stat.c b/gnu/usr.bin/cvs/vms/stat.c
new file mode 100644
index 00000000000..336247fb73f
--- /dev/null
+++ b/gnu/usr.bin/cvs/vms/stat.c
@@ -0,0 +1,26 @@
+#include <string.h>
+#include <stat.h>
+#include <unixlib.h>
+
+int wrapped_stat (path, buffer)
+const char *path;
+struct stat *buffer;
+{
+ char statpath[1024];
+ int rs;
+
+ strcpy(statpath, path);
+ strip_path(statpath);
+ if(strcmp(statpath, ".") == 0)
+ getwd(statpath);
+
+ if ((rs = stat (statpath, buffer)) < 0)
+ {
+ /* If stat() fails try again after appending ".dir" to the filename
+ this allows you to stat things like "bloogle/CVS" from VMS 6.1 */
+ strcat(statpath, ".dir");
+ rs = stat (statpath, buffer);
+ }
+
+ return rs;
+}