Ignore "+" before offset in cmd line convert

This commit is contained in:
Nikolaj Olsson 2019-11-29 16:01:00 +01:00
parent 960915c14b
commit ef08f30d0f

View File

@ -840,7 +840,7 @@ namespace Nikse.SubtitleEdit.Logic.CommandLineConvert
/// <param name="commandLineArguments">All unresolved arguments from the command line</param>
private static TimeSpan GetOffset(IList<string> commandLineArguments)
{
var offset = GetArgument(commandLineArguments, "offset:", "0");
var offset = GetArgument(commandLineArguments, "offset:", "0").TrimStart('+');
if (int.TryParse(offset, NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out var number) || int.TryParse(offset, NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out number))
{
return TimeSpan.FromMilliseconds(number);