Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xentools41 LDFLAGS Re: broken packages for 2012Q3



On Sat, Nov 24, 2012 at 10:40:54PM -0800, Aaron J. Grier wrote:

> see attached.  I can only vaguely follow ML, and did some cut-and-paste
> from rosetta code to do the necessary trailing newline trimming of
> /kern/xen/xsd_port.  I'm unclear of the license there, so this may need
> rewriting by someone more clued before being committed.

I'd write rtrim thusly:

let rtrim s =
  let aux s l = 
    if l < 0 then ""
    else match s.[l] with
      | '\t' | '\r' | '\n' | ' ' -> aux s (l-1)
      | _ -> String.sub s 0 (l+1)
  in
    aux s ((String.length s) - 1)

(* assuming you don't need right_pos anywhere *)

        -is


Home | Main Index | Thread Index | Old Index