mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Improved speed of strieq()
SVN revision: 852
This commit is contained in:
parent
92ad83d66f
commit
5f7ca5f239
25
src/elogd.c
25
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.311 2004/03/22 21:13:07 midas
|
||||||
|
Improved speed of strieq()
|
||||||
|
|
||||||
Revision 1.310 2004/03/22 14:17:31 midas
|
Revision 1.310 2004/03/22 14:17:31 midas
|
||||||
Implemented 'display <attribute>' for single entry display
|
Implemented 'display <attribute>' for single entry display
|
||||||
|
|
||||||
@ -531,6 +534,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
@ -831,18 +835,23 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n, char *inf
|
|||||||
|
|
||||||
/*---- Funcions from the MIDAS library -----------------------------*/
|
/*---- Funcions from the MIDAS library -----------------------------*/
|
||||||
|
|
||||||
|
#define my_toupper(_c) ( ((_c)>='a' && (_c)<='z') ? ((_c)-'a'+'A') : (_c) )
|
||||||
|
|
||||||
BOOL strieq(const char *str1, const char *str2)
|
BOOL strieq(const char *str1, const char *str2)
|
||||||
{
|
{
|
||||||
if (str1 == NULL && str2 != NULL)
|
char c1, c2;
|
||||||
return FALSE;
|
|
||||||
if (str1 != NULL && str2 == NULL)
|
|
||||||
return FALSE;
|
|
||||||
if (str1 == NULL && str2 == NULL)
|
if (str1 == NULL && str2 == NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
if (str1 == NULL || str2 == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
while (*str1)
|
while (*str1) {
|
||||||
if (toupper(*str1++) != toupper(*str2++))
|
c1 = *str1++;
|
||||||
|
c2 = *str2++;
|
||||||
|
if (my_toupper(c1) != my_toupper(c2))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (*str2)
|
if (*str2)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -12118,7 +12127,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n, char *inf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* redirect "go" command */
|
/* redirect "go" command */
|
||||||
if (isparam("lastcmd")) { //## and not copy to / move to / delete ...
|
if (isparam("lastcmd")) {
|
||||||
|
|
||||||
strlcpy(str, getparam("lastcmd"), sizeof(str));
|
strlcpy(str, getparam("lastcmd"), sizeof(str));
|
||||||
url_decode(str);
|
url_decode(str);
|
||||||
@ -18100,6 +18109,8 @@ int main(int argc, char *argv[])
|
|||||||
time_t now;
|
time_t now;
|
||||||
struct tm *tms;
|
struct tm *tms;
|
||||||
|
|
||||||
|
chdir("c:\\program files\\elog\\");
|
||||||
|
|
||||||
printf("elogd %s built %s, %s\n", VERSION, __DATE__, __TIME__);
|
printf("elogd %s built %s, %s\n", VERSION, __DATE__, __TIME__);
|
||||||
|
|
||||||
#ifdef OS_UNIX
|
#ifdef OS_UNIX
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user