File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,9 @@ void Terminal::Impl::onDeleteKey(SessionContext *s)
115
115
}
116
116
}
117
117
118
- void Terminal::Impl::onTabKey (SessionContext *s )
118
+ void Terminal::Impl::onTabKey (SessionContext *)
119
119
{
120
120
// !TODO: 实现补全功能
121
- LogUndo ();
122
- (void )s;
123
121
}
124
122
125
123
namespace {
Original file line number Diff line number Diff line change @@ -40,11 +40,12 @@ using std::ifstream;
40
40
using std::ofstream;
41
41
using std::exception;
42
42
43
- FileType GetFileType (const std::string &file_path)
43
+ FileType GetFileType (const std::string &file_path, bool refer_to_real_file )
44
44
{
45
- struct stat st ;
45
+ auto func = refer_to_real_file ? (:: stat) : (::lstat) ;
46
46
47
- if (::stat (file_path.c_str (), &st) == 0 ) {
47
+ struct stat st;
48
+ if (func (file_path.c_str (), &st) == 0 ) {
48
49
if (S_ISDIR (st.st_mode )) return FileType::kDirectory ;
49
50
if (S_ISREG (st.st_mode )) return FileType::kRegular ;
50
51
if (S_ISCHR (st.st_mode )) return FileType::kCharacterDevice ;
Original file line number Diff line number Diff line change @@ -47,10 +47,12 @@ enum class FileType {
47
47
/* *
48
48
* 获取文件类型
49
49
*
50
- * \param file_path 文件路径
50
+ * \param file_path 文件路径
51
+ * \param refer_to_real_file 如果是符号链接文件,是否指向真实的文件
52
+ *
51
53
* \return FileType 文件类型
52
54
*/
53
- FileType GetFileType (const std::string &file_path);
55
+ FileType GetFileType (const std::string &file_path, bool refer_to_real_file = false );
54
56
55
57
/* *
56
58
* 检查文件是否存在
Original file line number Diff line number Diff line change 21
21
# TBOX版本号
22
22
TBOX_VERSION_MAJOR := 1
23
23
TBOX_VERSION_MINOR := 12
24
- TBOX_VERSION_REVISION := 13
24
+ TBOX_VERSION_REVISION := 15
You can’t perform that action at this time.
0 commit comments