The following commit has been merged in the master branch:
commit 52557dc6333edfe1206d9dca3961e0509501bbfb
Author: Guillem Jover <[email protected]>
Date:   Fri Sep 11 14:47:36 2009 +0200

    dpkg-deb: Refactor file info structure creation into a new function

diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index 32b9d7b..c94daf5 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -103,6 +103,18 @@ static void checkversion(const char *vstring, const char 
*valuename, int *errs)
   (*errs)++;
 }
 
+static struct file_info *
+file_info_new(const char *filename)
+{
+  struct file_info *fi;
+
+  fi = m_malloc(sizeof(*fi));
+  fi->fn = m_strdup(filename);
+  fi->next = NULL;
+
+  return fi;
+}
+
 /*
  * Read the next filename from a filedescriptor and create a file_info struct
  * for it. If there is nothing to read return NULL.
@@ -148,10 +160,9 @@ getfi(const char *root, int fd)
       ohshit(_("file name '%.50s...' is too long"), fn + rl + 1);
   }
 
-  fi = m_malloc(sizeof(*fi));
+  fi = file_info_new(fn + rl + 1);
   lstat(fn, &(fi->st));
-  fi->fn = m_strdup(fn + rl + 1);
-  fi->next=NULL;
+
   return fi;
 }
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to