comparison src/gaimrc.c @ 3717:988485669631

[gaim-migrate @ 3850] Warning fixes and WIN32 ifdef removals committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Wed, 16 Oct 2002 19:57:03 +0000
parents 0f468c22c702
children 2567aabdf624
comparison
equal deleted inserted replaced
3716:d7e83b4db191 3717:988485669631
1218 if (opt_rcfile_arg) 1218 if (opt_rcfile_arg)
1219 g_snprintf(buf, sizeof(buf), "%s", opt_rcfile_arg); 1219 g_snprintf(buf, sizeof(buf), "%s", opt_rcfile_arg);
1220 else if (gaim_home_dir()) 1220 else if (gaim_home_dir())
1221 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S ".gaimrc", gaim_home_dir()); 1221 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S ".gaimrc", gaim_home_dir());
1222 else { 1222 else {
1223 #ifndef _WIN32
1224 set_defaults(); 1223 set_defaults();
1225 return; 1224 return;
1226 #else
1227 /* Pre Win 2000 there are no home dirs... */
1228 g_snprintf(buf, sizeof(buf), "C:" G_DIR_SEPARATOR_S ".gaimrc");
1229 #endif
1230 } 1225 }
1231 1226
1232 if ((f = fopen(buf, "r"))) { 1227 if ((f = fopen(buf, "r"))) {
1233 fgets(buf, sizeof(buf), f); 1228 fgets(buf, sizeof(buf), f);
1234 sscanf(buf, "# .gaimrc v%d", &ver); 1229 sscanf(buf, "# .gaimrc v%d", &ver);
1289 } 1284 }
1290 else if (gaim_home_dir()) { 1285 else if (gaim_home_dir()) {
1291 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S ".gaimrc", gaim_home_dir()); 1286 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S ".gaimrc", gaim_home_dir());
1292 } 1287 }
1293 else { 1288 else {
1294 #ifndef _WIN32
1295 return; 1289 return;
1296 #else
1297 /* Pre Win 2000, there are no home dirs.. */
1298 g_snprintf(buf, sizeof(buf), "C:" G_DIR_SEPARATOR_S ".gaimrc");
1299 #endif
1300 } 1290 }
1301 if ((f = fopen(buf, "w"))) { 1291 if ((f = fopen(buf, "w"))) {
1302 fprintf(f, "# .gaimrc v%d\n", 4); 1292 fprintf(f, "# .gaimrc v%d\n", 4);
1303 gaimrc_write_users(f); 1293 gaimrc_write_users(f);
1304 gaimrc_write_options(f); 1294 gaimrc_write_options(f);
1308 #ifdef GAIM_PLUGINS 1298 #ifdef GAIM_PLUGINS
1309 gaimrc_write_plugins(f); 1299 gaimrc_write_plugins(f);
1310 #endif 1300 #endif
1311 gaimrc_write_proxy(f); 1301 gaimrc_write_proxy(f);
1312 fclose(f); 1302 fclose(f);
1313 #ifndef _WIN32 1303
1314 chmod(buf, S_IRUSR | S_IWUSR); 1304 chmod(buf, S_IRUSR | S_IWUSR);
1315 #endif
1316 } 1305 }
1317 else 1306 else
1318 debug_printf("Error opening .gaimrc\n"); 1307 debug_printf("Error opening .gaimrc\n");
1319 } 1308 }
1320 1309