summaryrefslogtreecommitdiffstats
path: root/src/misc/extra/extraUtilFile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/extra/extraUtilFile.c')
-rw-r--r--src/misc/extra/extraUtilFile.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c
index cab36e29..2e1d60f4 100644
--- a/src/misc/extra/extraUtilFile.c
+++ b/src/misc/extra/extraUtilFile.c
@@ -630,6 +630,32 @@ char * Extra_StringAppend( char * pStrGiven, char * pStrAdd )
/**Function*************************************************************
+ Synopsis [Only keep characters belonging to the second string.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Extra_StringClean( char * pStrGiven, char * pCharKeep )
+{
+ char * pTemp, * pChar, * pSave = pStrGiven;
+ for ( pTemp = pStrGiven; *pTemp; pTemp++ )
+ {
+ for ( pChar = pCharKeep; *pChar; pChar++ )
+ if ( *pTemp == *pChar )
+ break;
+ if ( *pChar == 0 )
+ continue;
+ *pSave++ = *pTemp;
+ }
+ *pSave = 0;
+}
+
+/**Function*************************************************************
+
Synopsis [String comparison procedure.]
Description []