| 1230 | #endif |
| 1231 | |
| 1232 | static int |
| 1233 | length_without_val(const char *user_string, int len) |
| 1234 | { |
| 1235 | const char *p = strchr(user_string, ':'), *q = strchr(user_string, '='); |
| 1236 | |
| 1237 | if (!p || (q && q < p)) |
| 1238 | p = q; |
| 1239 | if (p) { |
| 1240 | /* 'user_string' hasn't necessarily been through mungspaces() |
| 1241 | so might have tabs or consecutive spaces */ |
| 1242 | while (p > user_string && isspace((uchar) * (p - 1))) |
| 1243 | p--; |
| 1244 | len = (int) (p - user_string); |
| 1245 | } |
| 1246 | return len; |
| 1247 | } |
| 1248 | |
| 1249 | /* check whether a user-supplied option string is a proper leading |
| 1250 | substring of a particular option name; option string might have |
no test coverage detected