Permalink
Browse files

. 列目录时,目录名称高亮显示,有别于普通文件。

. 显示包含空格的文件或目录时,不再显示转义符'\'。
. 录入包含空格的文件或目录时,可以使用转义符,也可以使用双引号。
  例如:/Program\ Files    或者    /“Program Files”
  • Loading branch information...
yaya
yaya committed Mar 19, 2017
1 parent 00c37ea commit 90167b05d2e1ff42eeda730b5ef17bd036dd37c1
View
@@ -1,4 +1,10 @@
更新说明:
2017-03-19(yaya)
列目录时,目录名称高亮显示,有别于普通文件。
显示包含空格的文件或目录时,不再显示转义符'\'。
录入包含空格的文件或目录时,可以使用转义符,也可以使用双引号。
例如:/Program\ Files 或者 /“Program Files”
2017-03-06(yaya)
USB2.0 驱动更新。
支持“AMD SB700/SB710/SB750 主板”,支持“神舟q230b网络本”等。
View
@@ -2046,6 +2046,12 @@ nul_terminate (char *str)
while ((ch = *str) && ! grub_isspace (ch))
{
if (ch == '"')
{
str++;
while (*str != '"')
str++;
}
if (ch == '\\')
{
str++;
View
@@ -45,7 +45,7 @@ static unsigned long long console_color_64bit[COLOR_STATE_MAX] = {
/* represents the user defined colors for normal text */
[COLOR_STATE_NORMAL] = 0xAAAAAA,
/* represents the user defined colors for highlighted text */
[COLOR_STATE_HIGHLIGHT] = 0xAAAAAA00000000ULL,
[COLOR_STATE_HIGHLIGHT] = 0xFFFFFF, //0xAAAAAA00000000ULL,
/* represents the user defined colors for help text */
[COLOR_STATE_HELPTEXT] = 0xAAAAAA,
/* represents the user defined colors for heading line */
View
@@ -215,14 +215,18 @@ unicode_to_utf8 (unsigned short *filename, unsigned char *utf8, unsigned long n)
{
if (uni <= 0x007F)
{
#if 0
if (uni != ' ')
#endif
utf8[k++] = uni;
#if 0
else
{
/* quote the SPACE with a backslash */
utf8[k++] = '\\';
utf8[k++] = uni;
}
#endif
}
else if (uni <= 0x07FF)
{
@@ -1644,13 +1648,25 @@ static int set_filename(char *filename)
{
char ch = nul_terminate(filename);
int i = grub_strlen(filename);
filename[i] = ch;
int j = grub_strlen(saved_dir);
int k;
if (i >= sizeof(open_filename) || (relative_path && grub_strlen(saved_dir)+i >= sizeof(open_filename)))
return !(errnum = ERR_WONT_FIT);
if (relative_path)
grub_sprintf (open_filename, "%s%.*s", saved_dir, i,filename);
else
grub_sprintf (open_filename, "%.*s", i,filename);
grub_sprintf (open_filename, "%s", saved_dir);
for (k = 0; filename[k]; k++)
{
if (filename[k] == '"' || filename[k] == '\\' )
continue;
else
open_filename[j++] = filename[k];
}
open_filename[j] = 0;
filename[i] = ch;
return 1;
}
View
@@ -35,6 +35,7 @@
#include "shared.h"
#include "filesys.h"
#include "iamath.h"
#include "term.h"
static int mapblock1, mapblock2;
@@ -1003,14 +1004,16 @@ ext2fs_dir (char *dirname)
//len = 0;
//while (dirname[len] && !isspace (dirname[len]))
// len++;
for (len = 0; (ch = dirname[len]) && !isspace (ch); len++)
for (len = 0; (ch = dirname[len]) /*&& !isspace (ch)*/; len++)
{
#if 0
if (ch == '\\')
{
len++;
if (! (ch = dirname[len]))
break;
}
#endif
}
/* Get the symlink size. */
@@ -1111,14 +1114,16 @@ ext2fs_dir (char *dirname)
/* skip to next slash or end of filename (space) */
// for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/';
// rest++);
for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++)
for (rest = dirname; (ch = *rest) /*&& !isspace (ch)*/ && ch != '/'; rest++)
{
#if 0
if (ch == '\\')
{
rest++;
if (! (ch = *rest))
break;
}
#endif
}
/* look through this directory and find the next filename component */
@@ -1204,8 +1209,10 @@ ext2fs_dir (char *dirname)
{
if (! (ch1 = dp->name[j]))
break;
#if 0
if (ch1 == ' ')
tmp_name[k++] = '\\';
#endif
tmp_name[k++] = ch1;
}
tmp_name[k] = 0;
@@ -1218,7 +1225,18 @@ ext2fs_dir (char *dirname)
{
if (print_possibilities > 0)
print_possibilities = -print_possibilities;
unsigned long long clo64 = current_color_64bit;
unsigned long clo = current_color;
if (dp->file_type == 2)
{
if (current_term->setcolorstate)
current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
current_color_64bit &= 0x0000000000ffffff;
current_color &= 0xf;
}
print_a_completion (tmp_name, 0);
current_color_64bit = clo64;
current_color = clo;
if (*tmp_name != 0x2e)
empty = 1;
}
View
@@ -23,6 +23,7 @@
#include "filesys.h"
#include "iamath.h"
#include "fat.h"
#include "term.h"
struct fat_superblock
{
@@ -556,15 +557,16 @@ fat_dir (char *dirname)
filemax = MAXINT;
/* check if the dirname ends in a slash(saved in CH) and end it in a NULL */
//for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++);
for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++)
for (rest = dirname; (ch = *rest) /*&& !isspace (ch)*/ && ch != '/'; rest++)
{
#if 0
if (ch == '\\')
{
rest++;
if (! (ch = *rest))
break;
}
#endif
}
*rest = 0;
@@ -763,7 +765,18 @@ fat_dir (char *dirname)
{
if (print_possibilities > 0)
print_possibilities = -print_possibilities;
unsigned long long clo64 = current_color_64bit;
unsigned long clo = current_color;
if ((FAT_SUPER->fat_type == 64 && exfat_attrib & 0x10) || (FAT_SUPER->fat_type != 64 && FAT_DIRENTRY_ATTRIB (dir_buf) & 0x10))
{
if (current_term->setcolorstate)
current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
current_color_64bit &= 0x0000000000ffffff;
current_color &= 0xf;
}
print_a_completion ((char *)utf8, 1);
current_color_64bit = clo64;
current_color = clo;
if (*(char *)utf8 != 0x2e)
empty = 1;
}
View
@@ -430,8 +430,10 @@ int fb_dir (char *dirname)
// if (! (ch1 = cur_file->name[j]))
if (! (ch1 = cur_file->name[j+((ver_min==6)?0:4)]))
break;
#if 0
if (ch1 == ' ')
tmp_name[k++] = '\\';
#endif
tmp_name[k++] = ch1;
}
tmp_name[k] = 0;
View
@@ -693,14 +693,16 @@ ffs_dir (char *dirname)
}
//for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++);
for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++)
for (rest = dirname; (ch = *rest) /*&& !isspace (ch)*/ && ch != '/'; rest++)
{
#if 0
if (ch == '\\')
{
rest++;
if (! (ch = *rest))
break;
}
#endif
}
*rest = 0;
@@ -747,8 +749,10 @@ ffs_dir (char *dirname)
{
if (! (ch1 = dp->d_name[j]))
break;
#if 0
if (ch1 == ' ')
tmp_name[k++] = '\\';
#endif
tmp_name[k++] = ch1;
}
tmp_name[k] = 0;
View
@@ -34,6 +34,7 @@
#include "shared.h"
#include "filesys.h"
#include "iso9660.h"
#include "term.h"
/* iso9660 super-block data in memory */
struct iso_sb_info {
@@ -266,11 +267,13 @@ iso9660_dir (char *dirname)
// ;
for (ch = tmp_name;*dirname;++dirname)
{
#if 0
if (*dirname == '\\')
{
*ch++ = *dirname++;
*ch++ = *dirname++;
}
#endif
if (/*isspace(*dirname) || */*dirname == '/')
break;
if (ch - tmp_name >= 255 || !(*ch = *dirname))
@@ -516,6 +519,7 @@ iso9660_dir (char *dirname)
filemax = MAXINT;
for (j = 0, k = 0;j < name_len;)
{
#if 0
if (name[j] == '\\')
{
tmp_name1[k++] = name[j++];
@@ -529,6 +533,7 @@ iso9660_dir (char *dirname)
tmp_name1[k++] = name[j++];
}
else
#endif
tmp_name1[k++] = name[j++];
}
tmp_name1[k] = 0;
@@ -605,8 +610,18 @@ iso9660_dir (char *dirname)
// tmp_name1[k++] = ch1;
// }
// tmp_name1[k] = 0;
unsigned long long clo64 = current_color_64bit;
unsigned long clo = current_color;
if (file_type == ISO_DIRECTORY)
{
if (current_term->setcolorstate)
current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
current_color_64bit &= 0x0000000000ffffff;
current_color &= 0xf;
}
print_a_completion (tmp_name1, 0);
current_color_64bit = clo64;
current_color = clo;
}
}
// } /* for */
View
@@ -353,14 +353,16 @@ jfs_dir (char *dirname)
for (; *dirname == '/'; dirname++);
//for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++);
for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++)
for (rest = dirname; (ch = *rest) /*&& !isspace (ch)*/ && ch != '/'; rest++)
{
#if 0
if (ch == '\\')
{
rest++;
if (! (ch = *rest))
break;
}
#endif
}
*rest = 0;
View
@@ -370,14 +370,16 @@ minix_dir (char *dirname)
//len = 0;
//while (dirname[len] && !isspace (dirname[len]))
// len++;
for (len = 0; (ch = dirname[len]) && !isspace (ch); len++)
for (len = 0; (ch = dirname[len]) /*&& !isspace (ch)*/; len++)
{
#if 0
if (ch == '\\')
{
len++;
if (! (ch = dirname[len]))
break;
}
#endif
}
/* Get the symlink size. */
@@ -454,14 +456,16 @@ minix_dir (char *dirname)
/* skip to next slash or end of filename (space) */
// for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/';
// rest++);
for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++)
for (rest = dirname; (ch = *rest) /*&& !isspace (ch)*/ && ch != '/'; rest++)
{
#if 0
if (ch == '\\')
{
rest++;
if (! (ch = *rest))
break;
}
#endif
}
/* look through this directory and find the next filename component */
@@ -536,8 +540,10 @@ minix_dir (char *dirname)
{
if (! (ch1 = dp->name[j]))
break;
#if 0
if (ch1 == ' ')
tmp_name[k++] = '\\';
#endif
tmp_name[k++] = ch1;
}
tmp_name[k] = 0;
Oops, something went wrong.

0 comments on commit 90167b0

Please sign in to comment.