Przeglądaj źródła

libdpkg: Use a variable to track the built-in arch list tail

This makes it more difficult to miss updating references to it in the
code when the built-in arch list is modified.
Guillem Jover 14 lat temu
rodzic
commit
6c291264fc
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      lib/dpkg/arch.c

+ 2 - 1
lib/dpkg/arch.c

@@ -97,6 +97,7 @@ static struct dpkg_arch arch_item_native = {
 	.next = &arch_item_all,
 	.next = &arch_item_all,
 };
 };
 static struct dpkg_arch *arch_list = &arch_item_native;
 static struct dpkg_arch *arch_list = &arch_item_native;
+static struct dpkg_arch *arch_builtin_tail = &arch_item_any;
 
 
 static struct dpkg_arch *
 static struct dpkg_arch *
 dpkg_arch_new(const char *name, enum dpkg_arch_type type)
 dpkg_arch_new(const char *name, enum dpkg_arch_type type)
@@ -200,7 +201,7 @@ dpkg_arch_get_list(void)
 void
 void
 dpkg_arch_reset_list(void)
 dpkg_arch_reset_list(void)
 {
 {
-	arch_item_any.next = NULL;
+	arch_builtin_tail->next = NULL;
 }
 }
 
 
 void
 void