MCPcopy Create free account
hub / github.com/Singular/Singular / strclean

Function strclean

Singular/fehelp.cc:364–380  ·  view source on GitHub ↗

* * Implementation: local function * *****************************************************************/ Remove whitspaces from beginning and end, return NULL if only whitespaces

Source from the content-addressed store, hash-verified

362 *****************************************************************/
363// Remove whitspaces from beginning and end, return NULL if only whitespaces
364static 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

Callers 1

feHelpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected