- Timestamp:
- Mar 24, 2011, 4:55:03 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 4e29ecb
- Parents:
- 3f52e14
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
re5da3fe r5d56a27 1167 1167 char *short_zuser(const char *in) 1168 1168 { 1169 char *out, *ptr; 1170 1171 out=g_strdup(in); 1172 ptr=strchr(out, '@'); 1173 if (ptr) { 1174 if (!strcasecmp(ptr+1, owl_zephyr_get_realm())) { 1175 *ptr='\0'; 1176 } 1177 } 1178 return(out); 1169 char *ptr = strrchr(in, '@'); 1170 if (ptr && (ptr[1] == '\0' || !strcasecmp(ptr+1, owl_zephyr_get_realm()))) { 1171 return g_strndup(in, ptr - in); 1172 } 1173 return g_strdup(in); 1179 1174 } 1180 1175 … … 1184 1179 char *long_zuser(const char *in) 1185 1180 { 1186 if (strchr(in, '@')) { 1187 return(g_strdup(in)); 1188 } 1189 return(g_strdup_printf("%s@%s", in, owl_zephyr_get_realm())); 1181 char *ptr = strrchr(in, '@'); 1182 if (ptr) { 1183 if (ptr[1]) 1184 return g_strdup(in); 1185 /* Ends in @, so assume default realm. */ 1186 return g_strdup_printf("%s%s", in, owl_zephyr_get_realm()); 1187 } 1188 return g_strdup_printf("%s@%s", in, owl_zephyr_get_realm()); 1190 1189 } 1191 1190
Note: See TracChangeset
for help on using the changeset viewer.