| 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); |