From e87284a8b417ac1d7429f8d7a5a626b30d955cb0 Mon Sep 17 00:00:00 2001 From: kala13x Date: Sat, 29 Apr 2023 14:08:13 +0400 Subject: [PATCH] Fixed xpass initialization --- Makefile | 6 +++--- build.sh | 4 ++-- examples/xpass.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6fcd63a..ac3aa2c 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # https://github.com/kala13x/smake # #################################### -CFLAGS = -g -O2 -Wall -D_XUTILS_DEBUG -D_XUTILS_USE_SSL -I./src -I./media +CFLAGS = -g -O2 -Wall -D_XUTILS_DEBUG -D_XUTILS_USE_SSL -I./media -I./src LIBS = -lpthread -lssl -lcrypto NAME = libxutils.a ODIR = ./obj @@ -43,7 +43,7 @@ OBJS = addr.$(OBJ) \ OBJECTS = $(patsubst %,$(ODIR)/%,$(OBJS)) INSTALL_INC = /usr/local/include/xutils INSTALL_BIN = /usr/local/lib -VPATH = ./src:./media +VPATH = ./media:./src .c.$(OBJ): @test -d $(ODIR) || mkdir -p $(ODIR) @@ -57,8 +57,8 @@ install: @test -d $(INSTALL_BIN) || mkdir -p $(INSTALL_BIN) @install -m 0755 $(ODIR)/$(NAME) $(INSTALL_BIN)/ @test -d $(INSTALL_INC) || mkdir -p $(INSTALL_INC) - @cp -r ./src/*.h $(INSTALL_INC)/ @cp -r ./media/*.h $(INSTALL_INC)/ + @cp -r ./src/*.h $(INSTALL_INC)/ .PHONY: clean clean: diff --git a/build.sh b/build.sh index 37be41f..36ad4e1 100755 --- a/build.sh +++ b/build.sh @@ -7,8 +7,8 @@ if [ -f "$LIB_CRYPTO" ] && [ -f "$LIB_SSL" ]; then export XUTILS_USE_SSL=y fi -if [ $OSTYPE == 'linux-gnu'* ]; then - CPU_COUNT=`cat /proc/cpuinfo | grep processor -c` +if [ $OSTYPE == linux-gnu ]; then + CPU_COUNT=$(nproc) else CPU_COUNT=1 fi diff --git a/examples/xpass.c b/examples/xpass.c index e27d278..1d4e608 100644 --- a/examples/xpass.c +++ b/examples/xpass.c @@ -766,7 +766,7 @@ static xbool_t XPass_InitConfigFile(xpass_ctx_t *pCtx) sAnswer[0] = XSTR_NUL; XASSERT((fgets(sAnswer, sizeof(sAnswer), stdin)), XFALSE); - XASSERT((sAnswer[0] == 'Y' && sAnswer[0] == 'y'), XFALSE); + XASSERT((sAnswer[0] == 'Y' || sAnswer[0] == 'y'), XFALSE); xpath_t path; XPath_Parse(&path, pCtx->sConf); @@ -830,7 +830,7 @@ static xbool_t XPass_InitConfigFile(xpass_ctx_t *pCtx) XJSON_FreeObject(pLayoutObj); return XFALSE; } - + xjson_writer_t writer; XJSON_InitWriter(&writer, NULL, XSTR_MIN); writer.nTabSize = 4; // Enable linter