Browse Source

Merge pull request #35 from mysterywolf/revert-33-master

revert remove memrchr
朱天龙 (Armink) 4 years ago
parent
commit
5f678d297a

+ 1 - 1
inc/webnet.h

@@ -1,7 +1,7 @@
 /*
  * File      : webnet.h
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
inc/wn_module.h

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module.h
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
inc/wn_request.h

@@ -1,7 +1,7 @@
 /*
  * File      : wn_request.h
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
inc/wn_session.h

@@ -1,7 +1,7 @@
 /*
  * File      : wn_session.h
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
inc/wn_utils.h

@@ -1,7 +1,7 @@
 /*
  * File      : wn_utils.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_alias.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_alias.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_asp.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_asp.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_auth.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_auth.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_cgi.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_cgi.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_dav.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_dav.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_index.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_index.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_log.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_log.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_lua.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_lua.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
module/wn_module_ssi.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_ssi.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 22 - 3
module/wn_module_upload.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module_upload.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -25,8 +25,6 @@
 #include <wn_module.h>
 #include <wn_utils.h>
 
-#include <strings.h>
-
 #ifdef RT_USING_DFS
 #include <dfs_posix.h>
 #endif
@@ -161,6 +159,27 @@ static char* memstrs(const char* str, size_t length, int num, ...)
     return ptr;
 }
 
+#if !(defined(__GNUC__) && !defined(__ARMCC_VERSION)/*GCC*/)
+static void* memrchr(const void *s, int c, size_t n)
+{
+    register const char* t=s;
+    register const char* last=0;
+    int i;
+
+    t = t + n;
+    for (i=n; i; --i)
+    {
+        if (*t==c)
+        {
+            last=t;
+            break;
+        }
+        t--;
+    }
+    return (void*)last; /* man, what an utterly b0rken prototype */
+}
+#endif
+
 static char* _webnet_module_upload_parse_header(struct webnet_session* session, char* buffer, rt_size_t length)
 {
     char *ptr, *ch, *end_ptr;

+ 1 - 1
samples/wn_sample.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_sample.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
samples/wn_sample_upload.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_sample_upload.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
src/webnet.c

@@ -1,7 +1,7 @@
 /*
  * File      : webnet.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
src/wn_mimetype.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_mimetype.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
src/wn_module.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_module.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 1 - 1
src/wn_request.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_request.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as

+ 2 - 2
src/wn_session.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_session.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -158,7 +158,7 @@ void webnet_session_printf(struct webnet_session *session, const char* fmt, ...)
     rt_uint32_t length;
 
     va_start(args, fmt);
-    length = rt_vsnprintf((char*)(session->buffer),
+    length = vsnprintf((char*)(session->buffer),
                        sizeof(session->buffer) - 1,
                        fmt, args);
     session->buffer[length] = '\0';

+ 1 - 1
src/wn_utils.c

@@ -1,7 +1,7 @@
 /*
  * File      : wn_utils.c
  * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2022, RT-Thread Development Team
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  *
  * This software is dual-licensed: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as