@@ -969,6 +969,7 @@ static int form_file_list(char **files, int file_cnt)
969
969
for (i = 0 ; i < file_cnt ; i ++ )
970
970
{
971
971
percent = NO_PROB ;
972
+ sp = NULL ;
972
973
if (!isdigit (files [i ][0 ]))
973
974
{
974
975
sp = files [i ];
@@ -1111,22 +1112,42 @@ static int form_file_list(char **files, int file_cnt)
1111
1112
lang = p ;
1112
1113
}
1113
1114
/* default */
1115
+ FILEDESC * system_dir_list = NULL , * local_list = NULL ;
1116
+ FILEDESC * system_dir_tail = NULL , * local_tail = NULL ;
1114
1117
if (!ret )
1115
1118
{
1116
- ret = add_file (
1117
- percent , fullpathname , NULL , & File_list , & File_tail , NULL );
1119
+ ret = add_file (100 , fullpathname , NULL , & system_dir_list ,
1120
+ & system_dir_tail , NULL );
1118
1121
}
1119
- if (!ret &&
1120
- strncmp (fullpathname , locpathname , sizeof (fullpathname )))
1122
+ if (strncmp (fullpathname , locpathname , sizeof (fullpathname )))
1121
1123
{
1122
- ret = add_file (
1123
- percent , locpathname , NULL , & File_list , & File_tail , NULL );
1124
+ add_file (
1125
+ 100 , locpathname , NULL , & local_list , & local_tail , NULL );
1124
1126
}
1125
- if (strncmp (fullpathname , locpathname , sizeof (fullpathname )) &&
1126
- strcmp (sp , "all" ) == 0 )
1127
+ if (!local_list )
1127
1128
{
1128
- add_file (
1129
- percent , locpathname , NULL , & File_list , & File_tail , NULL );
1129
+ system_dir_tail -> percent = percent ;
1130
+ File_tail = system_dir_tail ;
1131
+ File_list = system_dir_list ;
1132
+ }
1133
+ else if (strncmp (fullpathname , locpathname , sizeof (fullpathname )) &&
1134
+ strcmp (sp , "all" ) == 0 )
1135
+ {
1136
+ FILEDESC * parent_node = new_fp ();
1137
+ parent_node -> percent = percent ;
1138
+ parent_node -> child = system_dir_list ;
1139
+ system_dir_list -> next = local_list ;
1140
+ if (local_list )
1141
+ {
1142
+ local_list -> prev = system_dir_list ;
1143
+ }
1144
+ system_dir_list -> parent = parent_node ;
1145
+ if (local_list )
1146
+ {
1147
+ local_list -> parent = parent_node ;
1148
+ }
1149
+ File_tail = File_list = parent_node ;
1150
+ ret = 1 ;
1130
1151
}
1131
1152
if (!ret )
1132
1153
{
0 commit comments