From 14bec27e4d5a804c89db98e48d9faa8cc95bf581 Mon Sep 17 00:00:00 2001 From: esevece Date: Fri, 5 Apr 2013 05:35:28 +0000 Subject: [PATCH] strtrim function added git-svn-id: svn://kolibrios.org@3448 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/strings.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/programs/cmm/lib/strings.h b/programs/cmm/lib/strings.h index 2be109a951..65d698fcb0 100644 --- a/programs/cmm/lib/strings.h +++ b/programs/cmm/lib/strings.h @@ -12,6 +12,7 @@ // strlwr( ESI) --- kyrillic symbols may not work // strttl( EDX) // strtok( ESI) +// strtrim( ESI) --- removes "blank" characters (\r, \n and space) // chrnum(dword searchin, char symbol) // strcpyb(dword searchin, copyin, startstr, endstr) --- copy string between strings // strnumb(dword searchin, startstr, endstr) --- get number between strings @@ -85,6 +86,20 @@ inline fastcall int strlcpy(dword ESI, EDI, EBX) return 0; } +inline fastcall strtrim( ESI) +{ + EDI = ESI; + do{ + AL=DSBYTE[EDI]; + if (AL != '\32') && (AL != '\13') && (AL != '\10') + { + DSBYTE[ESI]=AL; + ESI++; + } + EDI++; + }while(AL!=0); + DSBYTE[ESI] = '\0'; +} inline fastcall void strcat( EDI, ESI)