2007/4/13, Mike Dransfield <[EMAIL PROTECTED]>:

I think its easier to keep the original in the end otherwise you will
end up with lots of special cases.  I thought that solution would cover
99% weirdly formatted filenames.

I am also interested in .blah-blo.screen0.conf and --blah-screen0.conf
as well as .-.-.-.-.-.-.-.-.-.-.-.-.conf.  These files could also
contain binary
data so we should check by copying random files into the options dir
with valid (and invalid) names (I haven't checked that yet, but it should
reject everything as early as possible).

The rest seems fine (although I don't personally see the advantage of
fnLen over len :))


I'm ok with keeping your method if it suits the problem best.
But I have here another patch for you, which actually should have been
included in the last patches but I forgot to commit them. So here it
is as single patch.

Regards,
Patrick
From b06f961921b01c171de8014b852d16b5b2968bad Mon Sep 17 00:00:00 2001
From: marex <[EMAIL PROTECTED]>
Date: Fri, 13 Apr 2007 18:35:15 +0200
Subject: [PATCH] Fixed bug with action parsing

---
 plugins/ini.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/plugins/ini.c b/plugins/ini.c
index 3dda8a8..07cd90f 100644
--- a/plugins/ini.c
+++ b/plugins/ini.c
@@ -500,6 +500,7 @@ parseAction(CompDisplay *d, char *optionName, char *optionValue, IniAction *acti
 	action->a.bell = FALSE;
 	action->a.edgeMask = 0;
 	action->a.edgeButton = 0;
+	action->valueMasks = 0;
     }
     /* detect a new option (might happen when the options are incomplete) */
     else if (action->valueMasks != ACTION_VALUES_ALL)
@@ -738,10 +740,10 @@ iniLoadOptionsFromFile (CompDisplay *d,
 	    if (action.realOptionName &&
 		!continueReading)
 	    {
-		o = compFindOption (option, nOption, action.realOptionName, 0);
-		if (o)
+		CompOption *realOption = compFindOption (option, nOption, action.realOptionName, 0);
+		if (realOption)
 		{
-		    value = o->value;
+		    value = realOption->value;
 
 		    value.action.type = action.a.type;
 		    value.action.key = action.a.key;
@@ -769,16 +771,12 @@ iniLoadOptionsFromFile (CompDisplay *d,
 		    free(action.realOptionName);
 		    action.realOptionName = NULL;
 
-		    /* we missed the current line because we exited it in the first call */
-		    if (!o && action.valueMasks == ACTION_VALUES_ALL)
-		    {
-		        action.valueMasks = 0;
+		    /* we missed the current line because we exited it in the first call.
+		       we also need to check wether we have a incomplete options here,
+		       because other while parsing the last line again, would caus real
+		       trouble. ;-) */
+		    if (!o && action.valueMasks != ACTION_VALUES_ALL)
 		        parseAction(d, optionName, optionValue, &action);
-		    }
-		    else
-		    {
-		        action.valueMasks = 0;
-		    }
 		}
 	    }
 	}
-- 
1.5.0

_______________________________________________
compiz mailing list
[EMAIL PROTECTED]
http://lists.freedesktop.org/mailman/listinfo/compiz

Reply via email to