hal: Branch 'origin'

Richard Hughes hughsient at kemper.freedesktop.org
Tue Nov 14 09:38:44 PST 2006


 hald/device_info.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

New commits:
diff-tree 17304fb8a816c1818ff2f524b9019ae9c7370a6f (from cb2d58efd6283e92edb12067b15358c44de3c99f)
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Tue Nov 14 17:31:11 2006 +0100

    fix copy_property for merge in FDI files
    
    This patch fixed a bug with copy_property in FDI files if you try to
    copy a property from an other device. If you try:
    
      <merge key="baz" type="copy_property">@info.parent:info.vendor</merge>
    
    The key get copied to the info.parent device instead of the currently
    processed device. The bug was introduced with commit 1ffd7638 by reuse a
    variable name for a temporary local variable.

diff --git a/hald/device_info.c b/hald/device_info.c
index 9ff8ba8..d991aed 100644
--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -806,16 +806,16 @@ handle_merge (struct rule *rule, HalDevi
 						   prop_to_merge, sizeof (prop_to_merge))) {
 				HAL_ERROR (("Could not resolve keypath '%s' on udi '%s'", value, hal_device_get_udi (d)));
 			} else {
-				HalDevice *d;
+				HalDevice *copyfrom;
 
-				d = hal_device_store_find (hald_get_gdl (), udi_to_merge_from);
-				if (d == NULL) {
-					d = hal_device_store_find (hald_get_tdl (), udi_to_merge_from);
+				copyfrom = hal_device_store_find (hald_get_gdl (), udi_to_merge_from);
+				if (copyfrom == NULL) {
+					copyfrom = hal_device_store_find (hald_get_tdl (), udi_to_merge_from);
 				}
-				if (d == NULL) {
+				if (copyfrom == NULL) {
 					HAL_ERROR (("Could not find device with udi '%s'", udi_to_merge_from));
 				} else {
-					hal_device_copy_property (d, prop_to_merge, d, key);
+					hal_device_copy_property (copyfrom, prop_to_merge, d, key);
 				}
 			}
 


More information about the hal-commit mailing list