From 38e8c1072f9bdd46666e6c1b97b4e9bdd0b29aad Mon Sep 17 00:00:00 2001 From: Nishi Date: Sat, 12 Oct 2024 00:44:34 +0000 Subject: [PATCH] fix git-svn-id: file:///raid/svn-personal/rbuild/trunk@20 c68d3453-7f82-0740-9748-1d72386a946b --- Common/cm_string.h | 8 ++++---- Common/string.c | 38 +++++++++++++++++++------------------- Makefile | 8 +++++++- Server/auth.c | 2 +- 4 files changed, 31 insertions(+), 25 deletions(-) diff --git a/Common/cm_string.h b/Common/cm_string.h index 0132139..b14cc6c 100644 --- a/Common/cm_string.h +++ b/Common/cm_string.h @@ -3,11 +3,11 @@ #ifndef __CM_STRING_H__ #define __CM_STRING_H__ -#include +#include int cm_hex(const char* str, int len); -bool cm_nocase_endswith(const char* str, const char* end); -bool cm_endswith(const char* str, const char* end); +CMBOOL cm_nocase_endswith(const char* str, const char* end); +CMBOOL cm_endswith(const char* str, const char* end); char* cm_html_escape(const char* str); char* cm_url_escape(const char* str); char* cm_strcat(const char* a, const char* b); @@ -17,6 +17,6 @@ char* cm_trimstart(const char* str); char* cm_trimend(const char* str); char* cm_trim(const char* str); char** cm_split(const char* str, const char* by); -bool cm_strcaseequ(const char* a, const char* b); +CMBOOL cm_strcaseequ(const char* a, const char* b); #endif diff --git a/Common/string.c b/Common/string.c index f138160..e42b354 100644 --- a/Common/string.c +++ b/Common/string.c @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -26,22 +26,22 @@ char* cm_strcat3(const char* a, const char* b, const char* c) { char* cm_strdup(const char* str) { return cm_strcat(str, ""); } -bool cm_endswith(const char* str, const char* end) { +CMBOOL cm_endswith(const char* str, const char* end) { int i; - if(strlen(str) < strlen(end)) return false; + if(strlen(str) < strlen(end)) return CMFALSE; for(i = strlen(str) - strlen(end); i < strlen(str); i++) { - if(str[i] != end[i - strlen(str) + strlen(end)]) return false; + if(str[i] != end[i - strlen(str) + strlen(end)]) return CMFALSE; } - return true; + return CMTRUE; } -bool cm_nocase_endswith(const char* str, const char* end) { +CMBOOL cm_nocase_endswith(const char* str, const char* end) { int i; - if(strlen(str) < strlen(end)) return false; + if(strlen(str) < strlen(end)) return CMFALSE; for(i = strlen(str) - strlen(end); i < strlen(str); i++) { - if(tolower(str[i]) != tolower(end[i - strlen(str) + strlen(end)])) return false; + if(tolower(str[i]) != tolower(end[i - strlen(str) + strlen(end)])) return CMFALSE; } - return true; + return CMTRUE; } char* cm_trimstart(const char* str) { @@ -78,17 +78,17 @@ char** cm_split(const char* str, const char* by) { char** r = malloc(sizeof(*r)); char* b = malloc(1); char cbuf[2]; - bool dq = false; - bool sq = false; + CMBOOL dq = CMFALSE; + CMBOOL sq = CMFALSE; r[0] = NULL; b[0] = 0; cbuf[1] = 0; for(i = 0;; i++) { int j; - bool has = false; + CMBOOL has = CMFALSE; for(j = 0; by[j] != 0; j++) { if(by[j] == str[i]) { - has = true; + has = CMTRUE; break; } } @@ -124,15 +124,15 @@ char** cm_split(const char* str, const char* by) { return r; } -bool cm_strcaseequ(const char* a, const char* b) { +CMBOOL cm_strcaseequ(const char* a, const char* b) { int i; - if(a == NULL) return false; - if(b == NULL) return false; - if(strlen(a) != strlen(b)) return false; + if(a == NULL) return CMFALSE; + if(b == NULL) return CMFALSE; + if(strlen(a) != strlen(b)) return CMFALSE; for(i = 0; a[i] != 0; i++) { - if(tolower(a[i]) != tolower(b[i])) return false; + if(tolower(a[i]) != tolower(b[i])) return CMFALSE; } - return true; + return CMTRUE; } int cm_hex(const char* str, int len) { diff --git a/Makefile b/Makefile index 250a3ac..0605252 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,16 @@ PWD = `pwd` FLAGS = PWD=$(PWD) PLATFORM=$(PLATFORM) -.PHONY: all get-version ./Common ./Server ./Client clean format +.PHONY: all get-version ./Common ./Server ./Client clean format src-archive all: ./Common ./Server ./Client +src-archive: clean + mkdir -p /tmp/rbuild-`grep "define RBUILD_VERSION" config.h | sed 's/#define RBUILD_VERSION //' | sed 's/"//g'` + cp -rf * /tmp/rbuild-`grep "define RBUILD_VERSION" config.h | sed 's/#define RBUILD_VERSION //' | sed 's/"//g'`/ + cd /tmp && tar --exclude .svn -czvf rbuild-`grep "define RBUILD_VERSION" rbuild-*/config.h | sed 's/#define RBUILD_VERSION //' | sed 's/"//g'`.tar.gz rbuild-`grep "define RBUILD_VERSION" rbuild-*/config.h | sed 's/#define RBUILD_VERSION //' | sed 's/"//g'`/ + mv /tmp/rbuild-`grep "define RBUILD_VERSION" config.h | sed 's/#define RBUILD_VERSION //' | sed 's/"//g'`.tar.gz ./ + get-version: @grep "define RBUILD_VERSION" config.h | sed 's/#define RBUILD_VERSION //' | sed 's/"//g' diff --git a/Server/auth.c b/Server/auth.c index 8c72e63..ea61dad 100644 --- a/Server/auth.c +++ b/Server/auth.c @@ -221,7 +221,7 @@ CMBOOL rbs_auth(const char* section, const char* username, const char* password) state = rbs_auth_plain(arg, username, password); } else #endif -#ifdef HAS_PLAIN_AUTH +#ifdef HAS_CRYPT_AUTH if(strcmp(auth, "crypt") == 0) { state = rbs_auth_crypt(arg, username, password); } else -- 2.45.2