]> Git repositories of Nishi - rbuild.git/commitdiff
fix
authorNishi <nishi@nishi.boats>
Sat, 12 Oct 2024 00:44:34 +0000 (00:44 +0000)
committerNishi <nishi@nishi.boats>
Sat, 12 Oct 2024 00:44:34 +0000 (00:44 +0000)
git-svn-id: file:///raid/svn-personal/rbuild/trunk@20 c68d3453-7f82-0740-9748-1d72386a946b

Common/cm_string.h
Common/string.c
Makefile
Server/auth.c

index 0132139f149391b03a8e8c9f370e562b240f0b0c..b14cc6cb0d06aafb58a42ce773d0c119d4012576 100644 (file)
@@ -3,11 +3,11 @@
 #ifndef __CM_STRING_H__
 #define __CM_STRING_H__
 
-#include <stdbool.h>
+#include <cm_bool.h>
 
 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
index f138160cd45229051081d18d2b92bf441b9f21d8..e42b35495b57f6f1128b56183a7c09a6b5afdf9c 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <string.h>
 #include <stdlib.h>
-#include <stdbool.h>
+#include <cm_bool.h>
 #include <stdio.h>
 #include <ctype.h>
 
@@ -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) {
index 250a3aceb3d04101cfe0a061f398acaf8ca238cb..06052522ad3003f6fa446637f949f3d25ca52960 100644 (file)
--- 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'
 
index 8c72e63c41b9e7adefd7253f140059f59e99a081..ea61dad93e9900934759a79f031fe92bf992bcee 100644 (file)
@@ -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