--- a/gRIM/gRIM.c Sun Jun 24 20:39:52 2007 -0400
+++ b/gRIM/gRIM.c Sun Jun 24 20:46:36 2007 -0400
@@ -119,8 +119,7 @@
GtkIMHtml *imhtml = GTK_IMHTML(gtkconv->entry);
- if (data->info->lyric == NULL)
+ if (data->info->lyric == NULL) { /* XXX: free the lyric if it was dyn-allocated */
@@ -131,8 +130,7 @@
list = data->info->lyric;
- if (list->next == NULL)
+ if (list->next == NULL) { /* Is this Ugly or is this UGLY? */
int len = strlen(list->data);
@@ -140,17 +138,14 @@
if (!gdk_color_parse(color, &gdkcolor))
gdkcolor.red = gdkcolor.green = gdkcolor.blue = 0;
inc_r = (255 - (gdkcolor.red >> 8))/len;
inc_g = (255 - (gdkcolor.green >> 8))/len;
inc_b = (255 - (gdkcolor.blue >> 8))/len;
@@ -165,8 +160,7 @@
gdkcolor.green += inc_g << 8;
gdkcolor.blue += inc_b << 8;
msg = g_strdup_printf("<font color=\"%s\">%s</font>", color, (char *)list->data);
msg = g_strdup(*(char*)list->data ? (char*)list->data : " ");
@@ -199,8 +193,7 @@
if (!file) /* XXX: Show an error message that the file doesn't exist */
- while (fgets(str, MAX_LENGTH, file))
+ while (fgets(str, MAX_LENGTH, file)) { char *s = str + strlen(str) - 1;
if (*s == '\r' || *s == '\n')
@@ -222,45 +215,41 @@
/* XXX: Need to manually parse the arguments :-/ */
- if (*args && *(args+1))
+ if (*args && *(args+1)) { /* two parameters: filename duration (in seconds) */
info->lyric = rim_get_file_lines(*args);
sscanf(*(args+1), "%d", &info->time);
/* one parameter: filename */
info->lyric = rim_get_file_lines(*args);
info->time = g_list_length(info->lyric) * 5000; /* at least 5 seconds between two lines */
list = g_list_append(list, g_strdup(LYRICS[i]));
- if(*args && !g_ascii_strcasecmp(*args,"quit"))
+ if(*args && !g_ascii_strcasecmp(*args,"quit")) { + GList *list = NULL, tmp = NULL; list = g_list_append(list, "Fine, I'll stop");
purple_debug_info("grim","HINT: quit with quit\n");
- if (info->lyric == NULL)
+ if (info->lyric == NULL) { return PURPLE_CMD_STATUS_FAILED;