Source code of Windows XP (NT5)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
/*
* REVISIONS: * ane11Dec92: Changed true and false to TRUE and FALSE, added os/2 includes * rct27Jan93: Fixed problem with comments * pcy16Feb93: Fixed removing trailing blanks from null strings ("") * cad18Nov93: Fix for EOF returned but not feof() * mholly06Oct98 : removed dead code, macros, and #defines - are left with * only the StripTrailingWhiteSpace function */
extern "C" { #include <ctype.h>
#include <string.h>
}
#include "scan.h"
// Macro definitions...
#define NEWLINE_SYMBOL '\n'
#define isNewline(c) (c == NEWLINE_SYMBOL)
#define isBlank(c) (isspace(c) && !isNewline(c))
//-------------------------------------------------------------------
// Removes trailing whitespace from the string
void StripTrailingWhiteSpace(char * aString) { int index = (strlen(aString)-1); while (isBlank(aString[index]) && index >= 0) { index--; } aString[index+1] = NULL; }
|