pinboard-elinks

Check-in [ba3a1fc143]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Temp fix for off by one error. Note from the Lua manual for string.byte and string.char: "Note that numerical codes are not necessarily portable across platforms." The original worked fine for me on OSX PPC, but on i386 NetBSD it's off by one. Could do with a better fix (I.e understanding it, rather than just sticking in the -1)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: ba3a1fc14377d499ffb92466e31743359d23d67294e7ba69831f8e5e4aa04e77
User & Date: atomicules@lavabit.com 2013-05-27 14:41:57
Context
2013-05-27
14:51
Change keybindings in README. Related to commit: 496ab7012455fdbf88e5129613d69c0289591c36 check-in: 4cdaa96f7d user: atomicules@lavabit.com tags: master, trunk
14:41
Temp fix for off by one error. Note from the Lua manual for string.byte and string.char: "Note that numerical codes are not necessarily portable across platforms." The original worked fine for me on OSX PPC, but on i386 NetBSD it's off by one. Could do with a better fix (I.e understanding it, rather than just sticking in the -1) check-in: ba3a1fc143 user: atomicules@lavabit.com tags: master, trunk
14:41
Change keybindings to suit my environment (Alt bindings conflict with dwm) check-in: 90f82277b0 user: atomicules@lavabit.com tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pinboard.lua.

99
100
101
102
103
104
105
106
107
108
109
110
111
112

--The following taken from the contrib hooks.lua sample
function hx (c)
    return string.char((c >= 10 and (c - 10) + string.byte ('A')) or c + string.byte ('0'))
end

function char2hex (c)
    return '%'..hx (string.byte (c) / 16)..hx (math.mod(string.byte (c), 16))
end

function escape (str)
    return string.gsub (str, "(%W)", char2hex)
end
--end stealing







|






99
100
101
102
103
104
105
106
107
108
109
110
111
112

--The following taken from the contrib hooks.lua sample
function hx (c)
    return string.char((c >= 10 and (c - 10) + string.byte ('A')) or c + string.byte ('0'))
end

function char2hex (c)
    return '%'..hx ((string.byte (c) / 16)-1)..hx (math.mod(string.byte (c), 16))
end

function escape (str)
    return string.gsub (str, "(%W)", char2hex)
end
--end stealing