summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>2008-10-02 19:12:59 +0000
committerAlexandra Ellwood <lxs@mit.edu>2008-10-02 19:12:59 +0000
commit880d2ef43c2c9a064c5f427910d23e023a4f48ff (patch)
tree7067f983e42eafd0410f39989d9262de673f51f0 /src
parentc781d197fecfe65a075458c50eeb34d6fa68c89f (diff)
downloadkrb5-880d2ef43c2c9a064c5f427910d23e023a4f48ff.tar.gz
krb5-880d2ef43c2c9a064c5f427910d23e023a4f48ff.tar.xz
krb5-880d2ef43c2c9a064c5f427910d23e023a4f48ff.zip
Fix to get application name correctly. Was dropping argument
from launchservices and not removing extension from path in fallback code. ticket: 6055 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20814 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/kim/lib/mac/kim_os_library.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/kim/lib/mac/kim_os_library.c b/src/kim/lib/mac/kim_os_library.c
index ecac38ca3..b0781bbf2 100644
--- a/src/kim/lib/mac/kim_os_library.c
+++ b/src/kim/lib/mac/kim_os_library.c
@@ -237,14 +237,16 @@ kim_error kim_os_library_get_caller_name (kim_string *out_application_name)
if (bundle_url) {
err = LSCopyDisplayNameForURL (bundle_url, &cfname);
+ check_error (err);
}
if (bundle_url) { CFRelease (bundle_url); }
}
- if (!err && !name) {
+ if (!err && !cfname) {
kim_string path = NULL;
CFURLRef cfpath = NULL;
+ CFURLRef cfpathnoext = NULL;
err = kim_os_library_get_application_path (&path);
@@ -253,12 +255,21 @@ kim_error kim_os_library_get_caller_name (kim_string *out_application_name)
(const UInt8 *) path,
strlen (path),
0);
+
if (cfpath) {
+ cfpathnoext = CFURLCreateCopyDeletingPathExtension (kCFAllocatorDefault,
+ cfpath);
+ }
+
+ if (cfpathnoext) {
+ cfname = CFURLCopyLastPathComponent (cfpathnoext);
+ } else {
cfname = CFURLCopyLastPathComponent (cfpath);
}
}
- if (cfpath) { CFRelease (cfpath); }
+ if (cfpathnoext) { CFRelease (cfpathnoext); }
+ if (cfpath ) { CFRelease (cfpath); }
}
if (!err && cfname) {