summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/contrib/strutl.h15
-rw-r--r--apt-pkg/deb/debversion.cc2
2 files changed, 16 insertions, 1 deletions
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h
index b6e6bfdce..8439af6fe 100644
--- a/apt-pkg/contrib/strutl.h
+++ b/apt-pkg/contrib/strutl.h
@@ -144,6 +144,21 @@ static inline int isspace_ascii_inline(int const c)
// 9='\t',10='\n',11='\v',12='\f',13='\r',32=' '
return (c >= 9 && c <= 13) || c == ' ';
}
+APT_PURE APT_HOT
+static inline int islower_ascii(int const c)
+{
+ return c >= 'a' && c <= 'z';
+}
+APT_PURE APT_HOT
+static inline int isupper_ascii(int const c)
+{
+ return c >= 'A' && c <= 'Z';
+}
+APT_PURE APT_HOT
+static inline int isalpha_ascii(int const c)
+{
+ return isupper_ascii(c) || islower_ascii(c);
+}
APT_PUBLIC std::string StripEpoch(const std::string &VerStr);
diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc
index d2ebd2805..005f1bce0 100644
--- a/apt-pkg/deb/debversion.cc
+++ b/apt-pkg/deb/debversion.cc
@@ -40,7 +40,7 @@ static int order(char c)
{
if (isdigit(c))
return 0;
- else if (isalpha(c))
+ else if (isalpha_ascii(c))
return c;
else if (c == '~')
return -1;