* * Implementation: local function * *****************************************************************/ Remove whitspaces from beginning and end, return NULL if only whitespaces
| 362 | *****************************************************************/ |
| 363 | // Remove whitspaces from beginning and end, return NULL if only whitespaces |
| 364 | static char* strclean(char* str) |
| 365 | { |
| 366 | if (str == NULL) return NULL; |
| 367 | char *s=str; |
| 368 | while ((*s <= ' ') && (*s != '\0')) s++; |
| 369 | if (*s == '\0') return NULL; |
| 370 | char *ss=s; |
| 371 | while (*ss!='\0') ss++; |
| 372 | ss--; |
| 373 | while ((*ss <= ' ') && (*ss != '\0')) |
| 374 | { |
| 375 | *ss='\0'; |
| 376 | ss--; |
| 377 | } |
| 378 | if (*ss == '\0') return NULL; |
| 379 | return s; |
| 380 | } |
| 381 | |
| 382 | // Finds help entry for key: |
| 383 | // returns filled-in hentry and TRUE, on success |