Changeset 2831

Show
Ignore:
Timestamp:
05/17/05 15:25:02 (3 years ago)
Author:
morris
Message:

Case senstive search if the user enters any uppercase letters when completing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wire/trunk/wire/files.c

    r1846 r2831  
    5454        char                                    *p, *name, *match, *path; 
    5555        char                                    base[ZA_PATH_SIZE], real_path[ZA_PATH_SIZE]; 
    56         int                                             length, bytes; 
     56        int                                             i, length, bytes, result; 
     57        bool                                    casesensitive; 
    5758         
    5859        name = ((*rl_filename_dequoting_function) ((char *) text, 0)); 
     
    8485        za_basename(name, base); 
    8586        length = strlen(base); 
     87        casesensitive = false; 
     88 
     89        for(i = 0; i < length; i++) { 
     90                if(isupper(base[i])) { 
     91                        casesensitive = true; 
     92 
     93                        break; 
     94                } 
     95        } 
    8696         
    8797        for(; node; ) { 
     
    92102                        continue; 
    93103                 
    94                 if(strncasecmp(file->name, base, length) == 0) { 
     104                result = casesensitive 
     105                        ? strncmp(file->name, base, length) 
     106                        : strncasecmp(file->name, base, length); 
     107 
     108                if(result == 0) { 
    95109                        /* append / if directory */ 
    96110                        if(file->type != WR_FILE_FILE)