@@ -1089,79 +1089,6 @@ void cmSystemTools::GlobDirs(const std::string& path,
1089
1089
}
1090
1090
}
1091
1091
1092
- void cmSystemTools::ExpandListArgument (cm::string_view arg,
1093
- std::vector<std::string>& argsOut,
1094
- bool emptyArgs)
1095
- {
1096
- // If argument is empty, it is an empty list.
1097
- if (!emptyArgs && arg.empty ()) {
1098
- return ;
1099
- }
1100
-
1101
- // if there are no ; in the name then just copy the current string
1102
- if (arg.find (' ;' ) == cm::string_view::npos) {
1103
- argsOut.emplace_back (arg);
1104
- return ;
1105
- }
1106
-
1107
- std::string newArg;
1108
- // Break the string at non-escaped semicolons not nested in [].
1109
- int squareNesting = 0 ;
1110
- cm::string_view::iterator last = arg.begin ();
1111
- cm::string_view::iterator const cend = arg.end ();
1112
- for (cm::string_view::iterator c = last; c != cend; ++c) {
1113
- switch (*c) {
1114
- case ' \\ ' : {
1115
- // We only want to allow escaping of semicolons. Other
1116
- // escapes should not be processed here.
1117
- cm::string_view::iterator cnext = c + 1 ;
1118
- if ((cnext != cend) && *cnext == ' ;' ) {
1119
- newArg.append (last, c);
1120
- // Skip over the escape character
1121
- last = cnext;
1122
- c = cnext;
1123
- }
1124
- } break ;
1125
- case ' [' : {
1126
- ++squareNesting;
1127
- } break ;
1128
- case ' ]' : {
1129
- --squareNesting;
1130
- } break ;
1131
- case ' ;' : {
1132
- // Break the string here if we are not nested inside square
1133
- // brackets.
1134
- if (squareNesting == 0 ) {
1135
- newArg.append (last, c);
1136
- // Skip over the semicolon
1137
- last = c + 1 ;
1138
- if (!newArg.empty () || emptyArgs) {
1139
- // Add the last argument if the string is not empty.
1140
- argsOut.push_back (newArg);
1141
- newArg.clear ();
1142
- }
1143
- }
1144
- } break ;
1145
- default : {
1146
- // Just append this character.
1147
- } break ;
1148
- }
1149
- }
1150
- newArg.append (last, cend);
1151
- if (!newArg.empty () || emptyArgs) {
1152
- // Add the last argument if the string is not empty.
1153
- argsOut.push_back (std::move (newArg));
1154
- }
1155
- }
1156
-
1157
- std::vector<std::string> cmSystemTools::ExpandedListArgument (
1158
- cm::string_view arg, bool emptyArgs)
1159
- {
1160
- std::vector<std::string> argsOut;
1161
- ExpandListArgument (arg, argsOut, emptyArgs);
1162
- return argsOut;
1163
- }
1164
-
1165
1092
bool cmSystemTools::SimpleGlob (const std::string& glob,
1166
1093
std::vector<std::string>& files,
1167
1094
int type /* = 0 */ )
0 commit comments