summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2021-12-09 11:52:12 +0100
committerJulian Andres Klode <jak@debian.org>2022-01-06 20:56:52 +0100
commit736f13cb421604cf68f3e078e5bf0b82e0ffbc92 (patch)
tree307e555558117843bd0dc0012e1b5b973b4c1b6e /apt-pkg/contrib
parent64205c6850cf4323af317eff371c131c1bb7ebfc (diff)
Introduce and use isalpha_ascii() in debversion rather than isalpha()
Avoid misclassifying additional alphabetical characters from certain locales as alpha and then sort them by ASCII...
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/strutl.h15
1 files changed, 15 insertions, 0 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);