fixed a bug in the hlink code - it wasn't taking account of the new
authorAndrew Tridgell <tridge@samba.org>
Sun, 5 Apr 1998 04:34:52 +0000 (04:34 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 5 Apr 1998 04:34:52 +0000 (04:34 +0000)
pointer list code for flist.

hlink.c
version.h

diff --git a/hlink.c b/hlink.c
index b3f1d27441a9d13bbdc72b25dd73e5b3666fac9c..eef7c54c9126852872dca7a4a1b3dfb5618e449b 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -47,23 +47,23 @@ static int hlink_count;
 void init_hard_links(struct file_list *flist)
 {
 #if SUPPORT_HARD_LINKS
-  if (flist->count < 2) return;
+       int i;
+       if (flist->count < 2) return;
 
-  if (hlink_list) free(hlink_list);
+       if (hlink_list) free(hlink_list);
     
-  if (!(hlink_list = 
-       (struct file_struct *)malloc(sizeof(hlink_list[0])*flist->count)))
-    out_of_memory("init_hard_links");
+       if (!(hlink_list = 
+             (struct file_struct *)malloc(sizeof(hlink_list[0])*flist->count)))
+               out_of_memory("init_hard_links");
 
-  bcopy((char *)flist->files,
-       (char *)hlink_list,
-       sizeof(hlink_list[0])*flist->count);
+       for (i = 0; i < flist->count; i++)
+               bcopy(flist->files[i], &hlink_list[i], sizeof(hlink_list[0]));
 
-  qsort(hlink_list,flist->count,
-       sizeof(hlink_list[0]),
-       (int (*)())hlink_compare);
+       qsort(hlink_list,flist->count,
+             sizeof(hlink_list[0]),
+             (int (*)())hlink_compare);
 
-  hlink_count=flist->count;
+       hlink_count=flist->count;
 #endif
 }
 
index 4b7236c7967d7007380b9d8e2f70fca5a978f747..fcabce09ac40cdbdfe433125c661ef4ee79e71d7 100644 (file)
--- a/version.h
+++ b/version.h
@@ -1 +1 @@
-#define VERSION "1.7.1"
+#define VERSION "1.7.2alpha"