On 30.11.2012 15:47, Arvydas Sidorenko wrote:
> Lua 5.1: string.gfind renamed to string.gmatch
> Lua 5.2: string.gfind removed

Uhm. So in lua 5.1 string.gfind and string.gmatch is the same function. Lua 5.2
only has string.gmatch.

Why don't we just always use gmatch then? Shouldn't that work in both 5.1 and
5.2? No need for distinguishing between the different versions here.

Uli

> Signed-off-by: Arvydas Sidorenko <asi...@gmail.com>
> ---
>  lib/menubar/utils.lua.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/menubar/utils.lua.in b/lib/menubar/utils.lua.in
> index e45a8bc..495314d 100644
> --- a/lib/menubar/utils.lua.in
> +++ b/lib/menubar/utils.lua.in
> @@ -9,6 +9,7 @@ local io = io
>  local table = table
>  local ipairs = ipairs
>  local string = string
> +string.gmatch = string.gfind or string.gmatch -- v5.1 - gfind; v5.2 - gmatch
>  local awful_util = require("awful.util")
>  local theme = require("beautiful")
>  
> @@ -150,7 +151,7 @@ function utils.parse(file)
>      -- line separated by semicolon.
>      if program.Categories then
>          program.categories = {}
> -        for category in program.Categories:gfind('[^;]+') do
> +        for category in string.gmatch(program.Categories, '[^;]+') do
>              table.insert(program.categories, category)
>          end
>      end


-- 
"In the beginning the Universe was created. This has made a lot of
 people very angry and has been widely regarded as a bad move."

-- 
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.

Reply via email to