From 6b9e50c5666abe384dba6676ed187bfa76c1a7fe Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Mon, 9 Aug 2021 01:09:48 +0800 Subject: [PATCH] no message --- general/src/function/daemon.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/general/src/function/daemon.cpp b/general/src/function/daemon.cpp index 0bd6707..f35afcf 100644 --- a/general/src/function/daemon.cpp +++ b/general/src/function/daemon.cpp @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-07-23 23:39:57 - * @LastEditTime: 2021-08-06 01:07:45 + * @LastEditTime: 2021-08-09 01:09:14 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \generallib\general\src\function\daemon.c @@ -17,6 +17,7 @@ void _process_start(string path){ } pclose(file); } + vector StripList(const char *in,const char* d){ vector ret; vector pos; @@ -40,7 +41,6 @@ vector StripList(const char *in,const char* d){ return ret; for(int i = 0;i < (len - strlen(d)) ; i++){ - std::cout< StripList(const char *in,const char* d){ } } if(found){ - printf("pos start %d\r\n",i); + // printf("pos start %d\r\n",i); i += sublen - 1; pos.push_back(i); continue; @@ -56,12 +56,16 @@ vector StripList(const char *in,const char* d){ } for(int i = 0; i < pos.size() - 1;i++){ if(pos[i + 1] != (pos[i] + sublen)){ - pos_strip_continue.push_back(pos[i]); - pos_strip_continue.push_back(pos[i + 1]); + pos_strip_continue.push_back(pos[i] + 1); + pos_strip_continue.push_back(pos[i + 1] - 1); } } - pos_strip_continue.push_back(strlen(in) - 1); - + if(pos_strip_continue[pos_strip_continue.size() - 1] != (strlen(in) - 1)){ + pos_strip_continue.push_back(pos_strip_continue[pos_strip_continue.size() - 1] + 1); + pos_strip_continue.push_back(strlen(in) - 1); + } + std::cout<