- strncpy(directory, get_text(),sizeof(directory));
- char *bp, *cp, *dp = &directory[0];
- if( *dp ) {
- if( dp[0] != '~' || dp[1] != 0 ) {
- for( cp=dp; *cp; ++cp ) {
- if( *cp != '/' ) continue;
- for( bp=cp; *bp=='/'; ++bp );
- if( *bp ) dp = cp;
- }
- if( *--cp != '/' ) return 1;
- while( cp>dp && *cp=='/' ) *cp-- = 0;
- }
- load_dirs(directory);
- calculate_suggestions(dir_entries);
- }