projects
/
reposerve
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed filenames returned by flist
[reposerve]
/
src
/
proto.c
diff --git
a/src/proto.c
b/src/proto.c
index
7d6466c
..
9701ab4
100644
(file)
--- a/
src/proto.c
+++ b/
src/proto.c
@@
-28,7
+28,7
@@
void flist_destroy(struct flist *flist)
}
}
}
}
-int flist_add(struct flist *flist, const char *fname, int contents)
+int flist_add(struct flist *flist, const char *name, const char *path, int contents)
{
FILE *fp;
struct proto_file_entry fent;
{
FILE *fp;
struct proto_file_entry fent;
@@
-43,8
+43,8
@@
int flist_add(struct flist *flist, const char *fname, int contents)
return -1;
}
return -1;
}
- if(!(fp = fopen(fname, "rb"))) {
- fprintf(stderr, "flist_add: failed to open file: %s: %s\n", fname, strerror(errno));
+ if(!(fp = fopen(path, "rb"))) {
+ fprintf(stderr, "flist_add: failed to open file: %s: %s\n", path, strerror(errno));
return -1;
}
fstat(fileno(fp), &st);
return -1;
}
fstat(fileno(fp), &st);
@@
-52,7
+52,7
@@
int flist_add(struct flist *flist, const char *fname, int contents)
fent.size = st.st_size;
fent.mtime = st.st_mtime;
fent.size = st.st_size;
fent.mtime = st.st_mtime;
- namelen = datalen = strlen(fname);
+ namelen = datalen = strlen(name);
if(contents) {
datalen += fent.size;
}
if(contents) {
datalen += fent.size;
}
@@
-92,7
+92,7
@@
int flist_add(struct flist *flist, const char *fname, int contents)
fent.nameoffs = flist->data_sz;
fent.namelen = namelen;
dptr = flist->data + flist->data_sz;
fent.nameoffs = flist->data_sz;
fent.namelen = namelen;
dptr = flist->data + flist->data_sz;
- memcpy(dptr, fname, namelen);
+ memcpy(dptr, name, namelen);
md5_begin(&md);
if(contents) {
md5_begin(&md);
if(contents) {