776{
777 int length, min_length;
778 const char *name_ptr, *cmd_name;
780
781 min_length = 0;
783
784 if (*prefix == '\0')
785 {
787 return;
788 }
789
790#ifdef DFS_USING_POSIX
791
792 {
793 char *ptr;
794
795 ptr = prefix + rt_strlen(prefix);
796 while (ptr != prefix)
797 {
798 if (*ptr == ' ')
799 {
800 msh_auto_complete_path(ptr + 1);
801 break;
802 }
803
804 ptr --;
805 }
806#if defined(RT_USING_MODULE) || defined(RT_USING_SMART)
807
808
809
810 if (ptr == prefix)
811 {
812 msh_auto_complete_path(ptr);
813 }
814#endif
815 }
816#endif
817
818
819 {
821 {
822
823 cmd_name = (
const char *) index->
name;
824 if (strncmp(prefix, cmd_name, strlen(prefix)) == 0)
825 {
826 if (min_length == 0)
827 {
828
829 name_ptr = cmd_name;
830
831 min_length = strlen(name_ptr);
832 }
833
834 length = str_common(name_ptr, cmd_name);
835 if (length < min_length)
836 min_length = length;
837
839 }
840 }
841 }
842
843
844 if (name_ptr != NULL)
845 {
846 rt_strncpy(prefix, name_ptr, min_length);
847 }
848
849 return ;
850}
struct finsh_syscall * _syscall_table_end
#define FINSH_NEXT_SYSCALL(index)
struct finsh_syscall * _syscall_table_begin