comparison libpurple/core.c @ 29721:c4f836780e1c

propagate from branch 'im.pidgin.pidgin' (head 5e3164a6a1df028fc66f7e072be0d78d9d995389) to branch 'im.pidgin.pidgin.next.minor' (head 6ee3a8d962ff2bb002967cc29bd5aa0b45bc2028)
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sat, 28 Nov 2009 02:22:49 +0000
parents 6e9917e067e6
children da81195f635e
comparison
equal deleted inserted replaced
29042:588a7aef5f7c 29721:c4f836780e1c
494 { 494 {
495 /* We're only going to duplicate a logs symlink. */ 495 /* We're only going to duplicate a logs symlink. */
496 if (purple_strequal(entry, "logs")) 496 if (purple_strequal(entry, "logs"))
497 { 497 {
498 char *link; 498 char *link;
499 #if GLIB_CHECK_VERSION(2,4,0)
500 err = NULL; 499 err = NULL;
501 500
502 if ((link = g_file_read_link(name, &err)) == NULL) 501 if ((link = g_file_read_link(name, &err)) == NULL)
503 { 502 {
504 char *name_utf8 = g_filename_to_utf8(name, -1, NULL, NULL, NULL); 503 char *name_utf8 = g_filename_to_utf8(name, -1, NULL, NULL, NULL);
510 g_dir_close(dir); 509 g_dir_close(dir);
511 g_free(status_file); 510 g_free(status_file);
512 g_free(old_user_dir); 511 g_free(old_user_dir);
513 return FALSE; 512 return FALSE;
514 } 513 }
515 #else
516 char buf[MAXPATHLEN];
517 size_t linklen;
518
519 if ((linklen = readlink(name, buf, sizeof(buf) - 1) == -1))
520 {
521 char *name_utf8 = g_filename_to_utf8(name, -1, NULL, NULL, NULL);
522 purple_debug_error("core", "Error reading symlink %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
523 name_utf8, g_strerror(errno));
524 g_free(name_utf8);
525 g_free(name);
526 g_dir_close(dir);
527 g_free(status_file);
528 g_free(old_user_dir);
529 return FALSE;
530 }
531 buf[linklen] = '\0';
532
533 /* This way we don't have to GLIB_VERSION_CHECK every g_free(link) below. */
534 link = g_strdup(buf);
535 #endif
536 514
537 logs_dir = g_build_filename(user_dir, "logs", NULL); 515 logs_dir = g_build_filename(user_dir, "logs", NULL);
538 516
539 if (purple_strequal(link, "../.purple/logs") || 517 if (purple_strequal(link, "../.purple/logs") ||
540 purple_strequal(link, logs_dir)) 518 purple_strequal(link, logs_dir))