浏览代码

dpkg-deb: Pass last the node to add to add_to_filist

Guillem Jover 17 年之前
父节点
当前提交
ac2874075e
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      dpkg-deb/build.c

+ 4 - 2
dpkg-deb/build.c

@@ -161,7 +161,9 @@ static struct _finfo* getfi(const char* root, int fd) {
  * After a _finfo struct is added to a list it may no longer be freed, we
  * After a _finfo struct is added to a list it may no longer be freed, we
  * assume full responsibility for its memory.
  * assume full responsibility for its memory.
  */
  */
-static void add_to_filist(struct _finfo* fi, struct _finfo** start, struct _finfo **end) {
+static void
+add_to_filist(struct _finfo **start, struct _finfo **end, struct _finfo *fi)
+{
   if (*start==NULL)
   if (*start==NULL)
     *start=*end=fi;
     *start=*end=fi;
   else 
   else 
@@ -469,7 +471,7 @@ void do_build(const char *const *argv) {
    */
    */
   while ((fi=getfi(directory, p3[0]))!=NULL)
   while ((fi=getfi(directory, p3[0]))!=NULL)
     if (S_ISLNK(fi->st.st_mode))
     if (S_ISLNK(fi->st.st_mode))
-      add_to_filist(fi,&symlist,&symlist_end);
+      add_to_filist(&symlist, &symlist_end, fi);
     else {
     else {
       if (write(p1[1], fi->fn, strlen(fi->fn)+1) ==- 1)
       if (write(p1[1], fi->fn, strlen(fi->fn)+1) ==- 1)
 	ohshite(_("failed to write filename to tar pipe (data)"));
 	ohshite(_("failed to write filename to tar pipe (data)"));