[nautilus-actions] Fix conversion of '%d/%f' to '%f' when there are other parameters



commit 1fca9010e83aa85463f46949e1facbb6189c3ed4
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Aug 20 09:30:13 2010 +0200

    Fix conversion of '%d/%f' to '%f' when there are other parameters

 ChangeLog                    |    3 +++
 src/core/na-object-profile.c |    7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b2dbc00..bd3e5e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-08-19 Pierre Wieser <pwieser trychlos org>
 
+	* src/core/na-object-profile.c (convert_pre_v3_parameters_str):
+	Fix conversion of '%d/%f' to '%f' when there are other parameters.
+
 	* src/core/na-icontext.c
 	(is_candidate_for_mimetypes): Improve debug messages.
 	(is_candidate_for_basenames): Take care of matchcase.
diff --git a/src/core/na-object-profile.c b/src/core/na-object-profile.c
index 20ac099..411eb11 100644
--- a/src/core/na-object-profile.c
+++ b/src/core/na-object-profile.c
@@ -447,6 +447,7 @@ convert_pre_v3_parameters( NAObjectProfile *profile )
 static gboolean
 convert_pre_v3_parameters_str( gchar *str )
 {
+	static const gchar *thisfn = "na_object_profile_convert_pre_v3_parameters_str";
 	gboolean changed;
 	gchar *iter = str;
 
@@ -455,15 +456,15 @@ convert_pre_v3_parameters_str( gchar *str )
 			strlen( iter ) > 0 &&
 			( iter = g_strstr_len( iter, strlen( iter ), "%" )) != NULL ){
 
-		g_debug( "convert_pre_v3_parameters_str: iter[1]='%c'", iter[1] );
+		g_debug( "%s: iter[1]='%c'", thisfn, iter[1] );
 		switch( iter[1] ){
 
 			/* as a special optimization case, "%d/%f" parameters
 			 * may be favourably converted to just "%f" instead of "%d/%b"
 			 */
 			case 'd':
-				if( !strcmp( iter, "%d/%f" )){
-					g_strlcpy( iter, iter+3, strlen( iter ));
+				if( !strncmp( iter, "%d/%f", 5 )){
+					strncpy( iter, iter+3, strlen( iter ));
 					changed = TRUE;
 				}
 				break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]