mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-19 10:01:24 +00:00
improve instance config handling
This commit is contained in:
parent
aca8b47868
commit
e32f34a063
2 changed files with 25 additions and 0 deletions
|
@ -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:
|
||||
|
|
18
EcCommand.m
18
EcCommand.m
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue