summaryrefslogtreecommitdiff
path: root/sftp-glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp-glob.c')
-rw-r--r--sftp-glob.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sftp-glob.c b/sftp-glob.c
index a432bdfc2..849ac65ed 100644
--- a/sftp-glob.c
+++ b/sftp-glob.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: sftp-glob.c,v 1.8 2001/07/14 15:10:17 stevesk Exp $"); 26RCSID("$OpenBSD: sftp-glob.c,v 1.9 2001/12/19 07:18:56 deraadt Exp $");
27 27
28#include "buffer.h" 28#include "buffer.h"
29#include "bufaux.h" 29#include "bufaux.h"
@@ -49,9 +49,9 @@ static void *
49fudge_opendir(const char *path) 49fudge_opendir(const char *path)
50{ 50{
51 struct SFTP_OPENDIR *r; 51 struct SFTP_OPENDIR *r;
52 52
53 r = xmalloc(sizeof(*r)); 53 r = xmalloc(sizeof(*r));
54 54
55 if (do_readdir(cur.fd_in, cur.fd_out, (char*)path, &r->dir)) 55 if (do_readdir(cur.fd_in, cur.fd_out, (char*)path, &r->dir))
56 return(NULL); 56 return(NULL);
57 57
@@ -110,7 +110,7 @@ static void
110attrib_to_stat(Attrib *a, struct stat *st) 110attrib_to_stat(Attrib *a, struct stat *st)
111{ 111{
112 memset(st, 0, sizeof(*st)); 112 memset(st, 0, sizeof(*st));
113 113
114 if (a->flags & SSH2_FILEXFER_ATTR_SIZE) 114 if (a->flags & SSH2_FILEXFER_ATTR_SIZE)
115 st->st_size = a->size; 115 st->st_size = a->size;
116 if (a->flags & SSH2_FILEXFER_ATTR_UIDGID) { 116 if (a->flags & SSH2_FILEXFER_ATTR_UIDGID) {
@@ -129,12 +129,12 @@ static int
129fudge_lstat(const char *path, struct stat *st) 129fudge_lstat(const char *path, struct stat *st)
130{ 130{
131 Attrib *a; 131 Attrib *a;
132 132
133 if (!(a = do_lstat(cur.fd_in, cur.fd_out, (char*)path, 0))) 133 if (!(a = do_lstat(cur.fd_in, cur.fd_out, (char*)path, 0)))
134 return(-1); 134 return(-1);
135 135
136 attrib_to_stat(a, st); 136 attrib_to_stat(a, st);
137 137
138 return(0); 138 return(0);
139} 139}
140 140
@@ -142,12 +142,12 @@ static int
142fudge_stat(const char *path, struct stat *st) 142fudge_stat(const char *path, struct stat *st)
143{ 143{
144 Attrib *a; 144 Attrib *a;
145 145
146 if (!(a = do_stat(cur.fd_in, cur.fd_out, (char*)path, 0))) 146 if (!(a = do_stat(cur.fd_in, cur.fd_out, (char*)path, 0)))
147 return(-1); 147 return(-1);
148 148
149 attrib_to_stat(a, st); 149 attrib_to_stat(a, st);
150 150
151 return(0); 151 return(0);
152} 152}
153 153
@@ -160,7 +160,7 @@ remote_glob(int fd_in, int fd_out, const char *pattern, int flags,
160 pglob->gl_closedir = (void (*)(void *))fudge_closedir; 160 pglob->gl_closedir = (void (*)(void *))fudge_closedir;
161 pglob->gl_lstat = fudge_lstat; 161 pglob->gl_lstat = fudge_lstat;
162 pglob->gl_stat = fudge_stat; 162 pglob->gl_stat = fudge_stat;
163 163
164 memset(&cur, 0, sizeof(cur)); 164 memset(&cur, 0, sizeof(cur));
165 cur.fd_in = fd_in; 165 cur.fd_in = fd_in;
166 cur.fd_out = fd_out; 166 cur.fd_out = fd_out;