diff plugins/filectl.c @ 179:8d8faeab01f6

[gaim-migrate @ 189] Added a TOC interface plugin. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 26 Apr 2000 02:49:59 +0000
parents e05e6373ea5a
children bb22fb4a7d39
line wrap: on
line diff
--- a/plugins/filectl.c	Wed Apr 26 01:29:21 2000 +0000
+++ b/plugins/filectl.c	Wed Apr 26 02:49:59 2000 +0000
@@ -9,12 +9,12 @@
 #include <string.h>
 #include <ctype.h>
 
-void *handle;
-int check;
-time_t mtime;
+static void *handle;
+static int check;
+static time_t mtime;
 
-void init_file();
-void check_file();
+static void init_file();
+static void check_file();
 
 extern void dologin(GtkWidget *, GtkWidget *);
 extern void do_quit();
@@ -36,7 +36,8 @@
 	while (fgets(buffer, sizeof buffer, file)) {
 		if (buffer[strlen(buffer) - 1] == '\n')
 			buffer[strlen(buffer) - 1] = 0;
-		printf("read: %s\n", buffer);
+		sprintf(debug_buff, "read: %s\n", buffer);
+		debug_print(debug_buff);
 		command = getarg(buffer, 0, 0);
 		if        (!strncasecmp(command, "signon", 6)) {
 			if (!blist) {
@@ -116,8 +117,11 @@
 	sprintf(file, "%s/.gaim/control", getenv("HOME"));
 
 	if ((stat (file, &finfo) == 0) && (finfo.st_size > 0))
-		if (mtime != finfo.st_mtime)
+		if (mtime != finfo.st_mtime) {
+			sprintf(debug_buff, "control changed, checking\n");
+			debug_print(debug_buff);
 			run_commands();
+		}
 }
 
 char *getarg(char *line, int which, int remain) {