]> git.mdlowis.com Git - projs/tide.git/commitdiff
updated fetch to support osx
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 19 Jul 2017 23:38:17 +0000 (19:38 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 19 Jul 2017 23:38:17 +0000 (19:38 -0400)
lib/x11.c
tide-fetch.rb

index 85c632adb069db3f511213733c37e2f74577be0b..4c3bf8d39fb4bb843d395e38d9c00cd1004191bb 100644 (file)
--- a/lib/x11.c
+++ b/lib/x11.c
@@ -263,7 +263,7 @@ static uint32_t special_keys(uint32_t key) {
 }
 
 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;
index add42719bc2eac4329e9802cff1c247f530facdc..5fcfc6df695722f205beba9d4c0b6a13853b1623 100755 (executable)
@@ -43,7 +43,11 @@ def open_with(app)
 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
@@ -53,7 +57,7 @@ def find_file(file)
 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