From: Ben Date: 2007-04-19T05:35:05+09:00 Subject: Re: ruby crashes on windows across three versions On Apr 18, 4:09 pm, "Tim Pease" wrote: > > Is line 63 of SourceControl.rb a call into the p4ruby API's? If so, > then you need to open a bug with the p4ruby developer(s). Since > p4ruby is a ruby C extension, the error most likely lies there. > Unfortunately no. I'll post the code (to my eternal embarrassment). I hate posting code to usenet groups. You get everything questioned from your variable names to your personal lineage. :) My qualifiers - this is my quick and dirty parser to get something going and I'm still learning ruby. Please be kind to me. :) ## The parameter passed in is a string containing the depot location ## followed by whitespace, followed by a local location ## e.g: ## "//Development/Product/Branch/... //workspace/Path/Name/Here...." ## Returns the Depot path and the local path for the provided viewspec line def SourceControl.parseViewSpecLine(line) depot = [] local = [] state = :findDepot line.each_byte do |b| ch = b.chr # convert to ascii case state when :findDepot depot << ch if ch !~ /\s/ state = :findDepotQuoted if ch == "\"" ## <-- Ln 63 HERE!! state = :findPath if ch =~ /\s/ when :findDepotQuoted depot << ch state = :findDepot if ch == "\"" when :findPath local << ch end end # Join the character arrays in a string and return an array of the two [depot.join, local.join] end