xuruidong commented on code in PR #9984:
URL: https://github.com/apache/apisix/pull/9984#discussion_r1286555802


##########
apisix/plugins/log-rotate.lua:
##########
@@ -88,9 +90,8 @@ local function get_log_path_info(file_type)
     local prefix = ngx.config.prefix()
 
     if conf_path then
-        local root = str_sub(conf_path, 1, 1)
         -- relative path
-        if root ~= "/" then
+        if str_byte(conf_path) ~= SLASH_BYTE then

Review Comment:
   refer 
https://moonbingbing.gitbooks.io/openresty-best-practices/content/lua/string_library.html
   
   
![image](https://github.com/apache/apisix/assets/20812895/00438be5-2434-4635-ad65-debd39d271bb)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to