Mercurial > pidgin
comparison src/protocols/zephyr/zephyr.c @ 12621:8aa0a62cf080
[gaim-migrate @ 14957]
better code
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Thu, 22 Dec 2005 13:56:18 +0000 |
parents | e856f985a0b9 |
children | 851b0bd7eb52 |
comparison
equal
deleted
inserted
replaced
12620:13599d978a31 | 12621:8aa0a62cf080 |
---|---|
1596 -- this should not require a password, and ideally should be kerberized ssh -- | 1596 -- this should not require a password, and ideally should be kerberized ssh -- |
1597 or | 1597 or |
1598 fsh username@hostname pathtotzc -e %s | 1598 fsh username@hostname pathtotzc -e %s |
1599 */ | 1599 */ |
1600 while(tzc_cmd_array[i] != NULL){ | 1600 while(tzc_cmd_array[i] != NULL){ |
1601 if (!g_strncasecmp(tzc_cmd_array[i],"%s",2)) { | 1601 if (!g_ascii_strncasecmp(tzc_cmd_array[i],"%s",2)) { |
1602 /* fprintf(stderr,"replacing %%s with %s\n",zephyr->exposure); */ | 1602 /* fprintf(stderr,"replacing %%s with %s\n",zephyr->exposure); */ |
1603 tzc_cmd_array[i] = g_strdup(zephyr->exposure); | 1603 tzc_cmd_array[i] = g_strdup(zephyr->exposure); |
1604 found_ps = TRUE; | 1604 found_ps = TRUE; |
1605 | 1605 |
1606 } else { | 1606 } else { |
1731 zephyr->username = g_strdup_printf("%s",username); | 1731 zephyr->username = g_strdup_printf("%s",username); |
1732 if ((realm = strchr(username,'@'))) | 1732 if ((realm = strchr(username,'@'))) |
1733 zephyr->realm = g_strdup_printf("%s",realm+1); | 1733 zephyr->realm = g_strdup_printf("%s",realm+1); |
1734 else { | 1734 else { |
1735 realm = (gchar *)gaim_account_get_string(gc->account,"realm",""); | 1735 realm = (gchar *)gaim_account_get_string(gc->account,"realm",""); |
1736 if (!g_strcasecmp(realm,"")) { | 1736 if (!*realm) { |
1737 realm = "local-realm"; | 1737 realm = "local-realm"; |
1738 } | 1738 } |
1739 zephyr->realm = g_strdup(realm); | 1739 zephyr->realm = g_strdup(realm); |
1740 g_strlcpy(__Zephyr_realm, (const char*)zephyr->realm, REALM_SZ-1); | 1740 g_strlcpy(__Zephyr_realm, (const char*)zephyr->realm, REALM_SZ-1); |
1741 } | 1741 } |
1767 z_call_s(ZInitialize(), "Couldn't initialize zephyr"); | 1767 z_call_s(ZInitialize(), "Couldn't initialize zephyr"); |
1768 z_call_s(ZOpenPort(&(zephyr->port)), "Couldn't open port"); | 1768 z_call_s(ZOpenPort(&(zephyr->port)), "Couldn't open port"); |
1769 z_call_s(ZSetLocation((char *)zephyr->exposure), "Couldn't set location"); | 1769 z_call_s(ZSetLocation((char *)zephyr->exposure), "Couldn't set location"); |
1770 | 1770 |
1771 realm = (gchar *)gaim_account_get_string(gc->account,"realm",""); | 1771 realm = (gchar *)gaim_account_get_string(gc->account,"realm",""); |
1772 if (!g_strcasecmp(realm,"")) { | 1772 if (!*realm) { |
1773 realm = ZGetRealm(); | 1773 realm = ZGetRealm(); |
1774 } | 1774 } |
1775 zephyr->realm = g_strdup(realm); | 1775 zephyr->realm = g_strdup(realm); |
1776 g_strlcpy(__Zephyr_realm, (const char*)zephyr->realm, REALM_SZ-1); | 1776 g_strlcpy(__Zephyr_realm, (const char*)zephyr->realm, REALM_SZ-1); |
1777 zephyr->username = g_strdup(ZGetSender()); | 1777 zephyr->username = g_strdup(ZGetSender()); |
1778 | 1778 |
1779 /* zephyr->realm = g_strdup(ZGetRealm()); */ | 1779 /* zephyr->realm = g_strdup(ZGetRealm()); */ |
1780 gaim_debug_info("zephyr","realm: %s\n",zephyr->realm); | 1780 gaim_debug_info("zephyr","realm: %s\n",zephyr->realm); |
1781 } | 1781 } |
1782 else { | 1782 else { |
1783 gaim_connection_error(gc,"Only ZEPH0.2 supported currently"); | 1783 gaim_connection_error(gc,"Only ZEPH0.2 supported currently"); |
1784 return; | 1784 return; |
1785 } | 1785 } |
1786 gaim_debug_info("zephyr","does it get here\n"); | 1786 gaim_debug_info("zephyr","does it get here\n"); |