comparison src/cmds.c @ 9428:796f510a6e19

[gaim-migrate @ 10247] Arun A Tharuvai writes: Slash commands with "w" (and "W") ignore space between it and the next command. This causes the trailing space to either: get treated as the first character of of an immediately following "s" (or "S") argument, or get treated as the entire contents of any following "w" (or "W") arguments. This patch of his, #982083, fixes those issues. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Tue, 29 Jun 2004 21:34:07 +0000
parents 5f6ba17ef9f5
children d6f398e80b32
comparison
equal deleted inserted replaced
9427:66b3f54527e6 9428:796f510a6e19
118 if (!*cur) 118 if (!*cur)
119 return (cmd->flags & GAIM_CMD_FLAG_ALLOW_WRONG_ARGS); 119 return (cmd->flags & GAIM_CMD_FLAG_ALLOW_WRONG_ARGS);
120 120
121 switch (cmd->args[i]) { 121 switch (cmd->args[i]) {
122 case 'w': 122 case 'w':
123 if (!(end = strchr(cur, ' '))) end = cur + strlen(cur); 123 if (!(end = strchr(cur, ' '))) {
124 (*args)[i] = g_strndup(cur, end - cur); 124 end = cur + strlen(cur);
125 cur += end - cur; 125 (*args)[i] = g_strndup(cur, end - cur);
126 cur = end;
127 } else {
128 (*args)[i] = g_strndup(cur, end - cur);
129 cur = end + 1;
130 }
126 break; 131 break;
127 case 'W': 132 case 'W':
128 if (!(end = strchr(cur, ' '))) end = cur + strlen(cur); 133 if (!(end = strchr(cur, ' '))) {
129 (*args)[i] = gaim_markup_slice(m, g_utf8_pointer_to_offset(s, cur), g_utf8_pointer_to_offset(s, end)); 134 end = cur + strlen(cur);
130 cur += end - cur; 135 (*args)[i] = gaim_markup_slice(m, g_utf8_pointer_to_offset(s, cur), g_utf8_pointer_to_offset(s, end));
131 break; 136 cur = end;
137 } else {
138 (*args)[i] = gaim_markup_slice(m, g_utf8_pointer_to_offset(s, cur), g_utf8_pointer_to_offset(s, end));
139 cur = end +1;
140 }
141 break;
132 case 's': 142 case 's':
133 (*args)[i] = g_strdup(cur); 143 (*args)[i] = g_strdup(cur);
134 cur = cur + strlen(cur); 144 cur = cur + strlen(cur);
135 break; 145 break;
136 case 'S': 146 case 'S':