Menu reports "Save ... found from a route with an unexpected name" for Surfliner 2

Bug #1207876 reported by Sid Penstone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Rails
Fix Released
Medium
James Ross

Bug Description

When clicking on "Resume" in Open Rails for a Surfliner 2 save, there is a message like:
"Warning: Save 2013-07-13 9:43:53 AM found from a route with an unexpected name: Surfliner 2 ."
Note the trailing space after the digit "2" before the period.

I noticed that in the .trk file,. the route is identified as ("Surfliner 2 "), with three trailing spaces after the digit "2".

Looking at the code, OR saves the name of the route in two different class objects in different formats: the TRKFile class
reads the route name with ReadStringBlock(), and saves it as .Name="Surfliner 2 " (with one trailing space); the Route class trims the string and saves it as .Name = "Surfliner 2". When the save files are processed, they contain the extra trailing space, and they are then compared against the trimmed version, leading to the error (Resumeform.cs: Line 196).

MSTS does not have any problem with the trailing spaces.

I edited the .trk file and removed the trailing spaces, and ORTS works fine with the modified file, but I wonder whether it would be a good idea to modify ORTS to handle the string uniformly, in case this or related problems arise in other routes.

James Ross (twpol)
Changed in or:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 1.0
James Ross (twpol)
Changed in or:
assignee: nobody → James Ross (twpol)
summary: - ORTS reports "...route with an unexpected name" reading Surfliner 2
- saves
+ Menu reports "Save ... found from a route with an unexpected name" for
+ Surfliner 2
Revision history for this message
James Ross (twpol) wrote :

Fixed in X2659.

Changed in or:
status: Triaged → Fix Committed
James Ross (twpol)
Changed in or:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.