}
static uint32_t getkey(XEvent* e) {
- uint32_t rune = RUNE_ERR;
+ int32_t rune = RUNE_ERR;
size_t len = 0;
char buf[8];
KeySym key;
end
def find_files(file)
- files = Dir.glob("./**/#{file}").sort_by(&:length)
+ if file.match(/^\.?\//)
+ files = [file]
+ else
+ files = Dir.glob("**/#{file}").sort_by(&:length)
+ end
raise RuleError.new() if files.length == 0
files
end
end
def mimetype(regex)
- mtype = `file -i #{$item} | cut -d' ' -f2`
+ mtype = `file --mime-type #{$item} | cut -d' ' -f2`
if not mtype.match(regex) then
raise RuleError.new()
end