fix path completion in Mac OS X file dialog

svn: r5642
This commit is contained in:
Matthew Flatt 2007-02-20 02:02:01 +00:00
parent 3b10623bad
commit c0bd2049a9
2 changed files with 7 additions and 3 deletions

View File

@ -3382,6 +3382,9 @@ int scheme_is_complete_path(const char *s, long len, int kind)
if (!len) if (!len)
return 0; return 0;
if (!kind)
kind = SCHEME_PLATFORM_PATH_KIND;
if (!scheme_is_relative_path(s, len, kind)) { if (!scheme_is_relative_path(s, len, kind)) {
if (kind == SCHEME_WINDOWS_PATH_KIND) { if (kind == SCHEME_WINDOWS_PATH_KIND) {
if (IS_A_DOS_SEP(s[0]) && IS_A_DOS_SEP(s[1])) { if (IS_A_DOS_SEP(s[0]) && IS_A_DOS_SEP(s[1])) {

View File

@ -258,7 +258,7 @@ extern "C" {
#endif #endif
extern "C" { extern "C" {
extern char *scheme_expand_filename(char* filename, int ilen, const char *errorin, int *ex, int guards); extern char *scheme_expand_filename(char* filename, int ilen, const char *errorin, int *ex, int guards);
extern int scheme_is_complete_path(const char *s, long len); extern int scheme_is_complete_path(const char *s, long len, int kind);
extern int scheme_file_exists(const char *s); extern int scheme_file_exists(const char *s);
extern char *scheme_find_completion(char *fn); extern char *scheme_find_completion(char *fn);
} }
@ -406,10 +406,11 @@ static OSStatus tab_evt_handler(EventHandlerCallRef inHandlerCallRef,
result = extract_string(ccbi); result = extract_string(ccbi);
len = strlen(result); len = strlen(result);
if (scheme_is_complete_path(result, len)) { if (scheme_is_complete_path(result, len, 0)) {
result = scheme_find_completion(result); result = scheme_find_completion(result);
} else } else {
result = NULL; result = NULL;
}
if (result) { if (result) {
CFStringRef str; CFStringRef str;