diff options
author | Julian Andres Klode <jak@debian.org> | 2015-12-27 00:51:59 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2015-12-27 01:20:41 +0100 |
commit | 74dedb4ae28fd4f7c89bf769708d4f7edc7ed79a (patch) | |
tree | a1d8539a50180611afcd34fac1e597aaf286cd19 /apt-pkg/deb | |
parent | 98b063439156595f74c89e923bf4d3fd51a3b36f (diff) |
Convert most callers of isspace() to isspace_ascii()
This converts all callers that read machine-generated data,
callers that might work with user input are not converted.
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 32 | ||||
-rw-r--r-- | apt-pkg/deb/debsrcrecords.cc | 6 | ||||
-rw-r--r-- | apt-pkg/deb/debsystem.cc | 4 |
3 files changed, 21 insertions, 21 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index bf9bc75ec..f3ab9d5d8 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -353,7 +353,7 @@ unsigned short debListParser::VersionHash() char *J = S; for (; Start != End; ++Start) { - if (isspace(*Start) != 0) + if (isspace_ascii(*Start) != 0) continue; *J++ = tolower_ascii(*Start); @@ -543,11 +543,11 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, bool const &ParseRestrictionsList) { // Strip off leading space - for (;Start != Stop && isspace(*Start) != 0; ++Start); + for (;Start != Stop && isspace_ascii(*Start) != 0; ++Start); // Parse off the package name const char *I = Start; - for (;I != Stop && isspace(*I) == 0 && *I != '(' && *I != ')' && + for (;I != Stop && isspace_ascii(*I) == 0 && *I != '(' && *I != ')' && *I != ',' && *I != '|' && *I != '[' && *I != ']' && *I != '<' && *I != '>'; ++I); @@ -573,19 +573,19 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, } // Skip white space to the '(' - for (;I != Stop && isspace(*I) != 0 ; I++); + for (;I != Stop && isspace_ascii(*I) != 0 ; I++); // Parse a version if (I != Stop && *I == '(') { // Skip the '(' - for (I++; I != Stop && isspace(*I) != 0 ; I++); + for (I++; I != Stop && isspace_ascii(*I) != 0 ; I++); if (I + 3 >= Stop) return 0; I = ConvertRelation(I,Op); // Skip whitespace - for (;I != Stop && isspace(*I) != 0; I++); + for (;I != Stop && isspace_ascii(*I) != 0; I++); Start = I; I = (const char*) memchr(I, ')', Stop - I); if (I == NULL || Start == I) @@ -593,7 +593,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, // Skip trailing whitespace const char *End = I; - for (; End > Start && isspace(End[-1]); End--); + for (; End > Start && isspace_ascii(End[-1]); End--); Ver.assign(Start,End-Start); I++; @@ -605,7 +605,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, } // Skip whitespace - for (;I != Stop && isspace(*I) != 0; I++); + for (;I != Stop && isspace_ascii(*I) != 0; I++); if (ParseArchFlags == true) { @@ -625,7 +625,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, while (I != Stop) { // look for whitespace or ending ']' - for (;End != Stop && !isspace(*End) && *End != ']'; ++End); + for (;End != Stop && !isspace_ascii(*End) && *End != ']'; ++End); if (unlikely(End == Stop)) return 0; @@ -652,7 +652,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, } I = End; - for (;I != Stop && isspace(*I) != 0; I++); + for (;I != Stop && isspace_ascii(*I) != 0; I++); } if (NegArch == true) @@ -663,7 +663,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, } // Skip whitespace - for (;I != Stop && isspace(*I) != 0; I++); + for (;I != Stop && isspace_ascii(*I) != 0; I++); } if (ParseRestrictionsList == true) @@ -696,7 +696,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, for (;End != Stop && *End != '>'; ++End); I = ++End; // skip whitespace - for (;I != Stop && isspace(*I) != 0; I++); + for (;I != Stop && isspace_ascii(*I) != 0; I++); } else { bool applies2 = true; // all the conditions inside a restriction list have to be @@ -706,7 +706,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, { // look for whitespace or ending '>' // End now points to the character after the current term - for (;End != Stop && !isspace(*End) && *End != '>'; ++End); + for (;End != Stop && !isspace_ascii(*End) && *End != '>'; ++End); if (unlikely(End == Stop)) return 0; @@ -739,13 +739,13 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, if (*End++ == '>') { I = End; // skip whitespace - for (;I != Stop && isspace(*I) != 0; I++); + for (;I != Stop && isspace_ascii(*I) != 0; I++); break; } I = End; // skip whitespace - for (;I != Stop && isspace(*I) != 0; I++); + for (;I != Stop && isspace_ascii(*I) != 0; I++); } if (applies2) { applies1 = true; @@ -764,7 +764,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, if (I == Stop || *I == ',' || *I == '|') { if (I != Stop) - for (I++; I != Stop && isspace(*I) != 0; I++); + for (I++; I != Stop && isspace_ascii(*I) != 0; I++); return I; } diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 9404b6421..cef7ad10e 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -48,7 +48,7 @@ const char **debSrcRecordParser::Binaries() const char *Start, *End; if (Sect.Find("Binary", Start, End) == false) return NULL; - for (; isspace(*Start) != 0; ++Start); + for (; isspace_ascii(*Start) != 0; ++Start); if (Start >= End) return NULL; @@ -60,13 +60,13 @@ const char **debSrcRecordParser::Binaries() do { char* binStartNext = strchrnul(bin, ','); char* binEnd = binStartNext - 1; - for (; isspace(*binEnd) != 0; --binEnd) + for (; isspace_ascii(*binEnd) != 0; --binEnd) binEnd = 0; StaticBinList.push_back(bin); if (*binStartNext != ',') break; *binStartNext = '\0'; - for (bin = binStartNext + 1; isspace(*bin) != 0; ++bin) + for (bin = binStartNext + 1; isspace_ascii(*bin) != 0; ++bin) ; } while (*bin != '\0'); StaticBinList.push_back(NULL); diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index dcd115b50..56ca8f4c6 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -399,10 +399,10 @@ std::vector<std::string> debSystem::SupportedArchitectures() /*{{{*/ char* tok_saveptr; char* arch = strtok_r(buf, " ", &tok_saveptr); while (arch != NULL) { - for (; isspace(*arch) != 0; ++arch); + for (; isspace_ascii(*arch) != 0; ++arch); if (arch[0] != '\0') { char const* archend = arch; - for (; isspace(*archend) == 0 && *archend != '\0'; ++archend); + for (; isspace_ascii(*archend) == 0 && *archend != '\0'; ++archend); string a(arch, (archend - arch)); if (std::find(archs.begin(), archs.end(), a) == archs.end()) archs.push_back(a); |