improve instance config handling

This commit is contained in:
Richard Frith-Macdonald 2022-02-28 16:41:50 +00:00
parent aca8b47868
commit e32f34a063
2 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2022-02-28 Richard Frith-Macdonald <rfm@gnu.org>
* EcCommand.m:
When building config for a process, only count the part of a process
name after the last hyphen as an instance ID if it is entirely
composed of digits.
2022-02-08 Richard Frith-Macdonald <rfm@gnu.org>
* EcCommand.m:

View file

@ -4954,7 +4954,25 @@ NSLog(@"Problem %@", localException);
options: NSBackwardsSearch | NSLiteralSearch];
if (r.length > 0)
{
NSString *inst = [name substringFromIndex: NSMaxRange(r)];
NSUInteger len = [inst length];
base = [name substringToIndex: r.location];
if ([inst length] == 0)
{
base = nil; // Not an instance ID after hyphen
}
else
{
while (len-- > 0)
{
if (!isdigit([inst characterAtIndex: len]))
{
base = nil; // not positive integer after hyphen
break;
}
}
}
}
else
{