Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
5865-filename-Stricten-tests-for-integers.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5865-filename-Stricten-tests-for-integers.patch of Package erlang
From 3ad38446a58ab56b1f3aab6f7052da84b2bb9e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Wed, 22 Jun 2022 06:38:52 +0200 Subject: [PATCH 5/7] filename: Stricten tests for integers --- lib/stdlib/src/filename.erl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/stdlib/src/filename.erl b/lib/stdlib/src/filename.erl index 8bf4e97b9f..fc8e8110a0 100644 --- a/lib/stdlib/src/filename.erl +++ b/lib/stdlib/src/filename.erl @@ -78,8 +78,10 @@ -include_lib("kernel/include/file.hrl"). --define(IS_DRIVELETTER(Letter),(((Letter >= $A) andalso (Letter =< $Z)) orelse - ((Letter >= $a) andalso (Letter =< $z)))). +-define(IS_DRIVELETTER(Letter), + (is_integer(Letter) + andalso (($A =< Letter andalso Letter =< $Z) + orelse ($a =< Letter andalso Letter =< $z)))). %% Converts a relative filename to an absolute filename %% or the filename itself if it already is an absolute filename @@ -333,8 +335,7 @@ dirname([$/|Rest], Dir, File, Seps) -> dirname([DirSep|Rest], Dir, File, {DirSep,_}=Seps) when is_integer(DirSep) -> dirname(Rest, File++Dir, [$/], Seps); dirname([Dl,DrvSep|Rest], [], [], {_,DrvSep}=Seps) - when is_integer(DrvSep), ((($a =< Dl) and (Dl =< $z)) or - (($A =< Dl) and (Dl =< $Z))) -> + when is_integer(DrvSep), ?IS_DRIVELETTER(Dl) -> dirname(Rest, [DrvSep,Dl], [], Seps); dirname([Char|Rest], Dir, File, Seps) when is_integer(Char) -> dirname(Rest, Dir, [Char|File], Seps); @@ -757,7 +758,8 @@ win32_split([X, $\\|Rest]) when is_integer(X) -> win32_split([X, $/|Rest]); win32_split([X, Y, $\\|Rest]) when is_integer(X), is_integer(Y) -> win32_split([X, Y, $/|Rest]); -win32_split([UcLetter, $:|Rest]) when UcLetter >= $A, UcLetter =< $Z -> +win32_split([UcLetter, $:|Rest]) + when is_integer(UcLetter), $A =< UcLetter, UcLetter =< $Z -> win32_split([UcLetter+$a-$A, $:|Rest]); win32_split([Letter, $:, $/|Rest]) -> split(Rest, [], [[Letter, $:, $/]], win32); -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor