| 122 | */ |
| 123 | |
| 124 | size_t strlength(const char *str) |
| 125 | { |
| 126 | reg1 const char * pos; |
| 127 | reg2 const char * found; |
| 128 | DBUG_ENTER("strlength"); |
| 129 | |
| 130 | pos= found= str; |
| 131 | |
| 132 | while (*pos) |
| 133 | { |
| 134 | if (*pos != ' ') |
| 135 | { |
| 136 | while (*++pos && *pos != ' ') {}; |
| 137 | if (!*pos) |
| 138 | { |
| 139 | found=pos; /* String ends here */ |
| 140 | break; |
| 141 | } |
| 142 | } |
| 143 | found=pos; |
| 144 | while (*++pos == ' ') {}; |
| 145 | } |
| 146 | DBUG_RETURN((size_t) (found - str)); |
| 147 | } /* strlength */ |