mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-20 18:32:09 +00:00
improve managed object name creation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@35786 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a08ead3650
commit
b320fe92e5
1 changed files with 8 additions and 10 deletions
18
EcAlarm.m
18
EcAlarm.m
|
@ -51,11 +51,9 @@ EcMakeManagedObject(NSString *host, NSString *process, NSString *component)
|
|||
{
|
||||
host = [[NSHost currentHost] wellKnownName];
|
||||
}
|
||||
else
|
||||
{
|
||||
// No underscores permitted.
|
||||
host = [host stringByReplacingString: @"_" withString: @"-"];
|
||||
}
|
||||
// No underscores permitted.
|
||||
host = [host stringByTrimmingSpaces];
|
||||
host = [host stringByReplacingString: @"_" withString: @"-"];
|
||||
|
||||
if (nil == process)
|
||||
{
|
||||
|
@ -91,17 +89,17 @@ EcMakeManagedObject(NSString *host, NSString *process, NSString *component)
|
|||
}
|
||||
}
|
||||
// No underscores permitted.
|
||||
process = [process stringByTrimmingSpaces];
|
||||
process = [process stringByReplacingString: @"_" withString: @"-"];
|
||||
|
||||
if (nil == component)
|
||||
{
|
||||
component = @"";
|
||||
}
|
||||
else
|
||||
{
|
||||
// No underscores permitted.
|
||||
component = [component stringByReplacingString: @"_" withString: @"-"];
|
||||
}
|
||||
|
||||
// No underscores permitted.
|
||||
component = [component stringByTrimmingSpaces];
|
||||
component = [component stringByReplacingString: @"_" withString: @"-"];
|
||||
|
||||
return [NSString stringWithFormat: @"%@_%@_%@_%@",
|
||||
host, process, instance, component];
|
||||
|
|
Loading…
Reference in a new issue