changeset 297:76cdc3f1fe34

Fix broken remove_common_prefix(), fCamera didn't display model as it should.
author zas_
date Thu, 10 Apr 2008 00:09:43 +0000
parents a00a7ef75f74
children cb93a982fcdd
files src/exif-common.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/exif-common.c	Wed Apr 09 22:47:43 2008 +0000
+++ b/src/exif-common.c	Thu Apr 10 00:09:43 2008 +0000
@@ -77,11 +77,12 @@
 
 	if (!s || !t) return t;
 
-	for (i = 0; s[i] == t[i]; i++)
+	for (i = 0; s[i] && t[i] && s[i] == t[i]; i++)
 		;
 	if (!i) 
 		return t;
-	if (s[i]==' ' || s[i]==0)
+	--i;
+	if (s[i]==' ' || !s[i])
 		{
 		while (t[i] == ' ')
 			i++;