From: <ik...@us...> - 2008-04-30 03:41:52
|
Revision: 1537 http://cutter.svn.sourceforge.net/cutter/?rev=1537&view=rev Author: ikezoe Date: 2008-04-29 20:41:37 -0700 (Tue, 29 Apr 2008) Log Message: ----------- returns TRUE if both strings is NULL. returms FALSE if one strings is NULL. remove NULL check of strings[i] since g_strv_length() counts until NULL. Modified Paths: -------------- trunk/cutter/cut-utils.c Modified: trunk/cutter/cut-utils.c =================================================================== --- trunk/cutter/cut-utils.c 2008-04-30 03:38:25 UTC (rev 1536) +++ trunk/cutter/cut-utils.c 2008-04-30 03:41:37 UTC (rev 1537) @@ -52,14 +52,18 @@ { gint i, length; + if (!strings1 && !strings2) + return TRUE; + + if (!strings1 || !strings2) + return FALSE; + length = g_strv_length((gchar **)strings1); if (length != g_strv_length((gchar **)strings2)) return FALSE; for (i = 0; i < length; i++) { - if (!strings1[i] || !strings2[i]) - return FALSE; if (strcmp(strings1[i], strings2[i])) return FALSE; } @@ -68,5 +72,5 @@ } /* -vi:nowrap:ai:expandtab:sw=4 +vi:ts=4:nowrap:ai:expandtab:sw=4 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |