Guest User

Untitled

a guest
Oct 7th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.90 KB | None | 0 0
  1. From 8547029c1b53e71454baa039b1bef1da208e941f Mon Sep 17 00:00:00 2001
  2. From: Wojciech Meyer <[email protected]>
  3. Date: Mon, 8 Oct 2012 02:46:49 +0100
  4. Subject: [PATCH] Remove unsafe hd
  5.  
  6. ---
  7. odb.ml |    4 +++-
  8.  1 files changed, 3 insertions(+), 1 deletions(-)
  9.  
  10. diff --git a/odb.ml b/odb.ml
  11. index 49e79bf..d2d29d5 100755
  12. --- a/odb.ml
  13. +++ b/odb.ml
  14. @@ -492,7 +492,9 @@ module Dep = struct
  15.                  else []) lines |> List.concat
  16.        (* Consider only base packages, filter out the package we are installing to
  17.           handle cases where we have sub packages *)
  18. -      |> List.map (fun p -> Str.split (Str.regexp "\\.") p |> List.hd)
  19. +      |> fun x -> (match List.map (fun p -> Str.split (Str.regexp "\\.") p) x with
  20. +        | hd :: _ -> hd
  21. +        | [] -> [])
  22.        |> List.filter ((<>) p)
  23.        |> List.filter (fun p -> not (Str.string_match weird_rx p 0))
  24.      in
  25. --
  26. 1.7.4.1
Advertisement
Add Comment
Please, Sign In to add comment