File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,8 @@ ada_really_inline void remove_ascii_tab_or_newline(std::string& input) noexcept;
8282
8383/* *
8484 * @private
85- * Return the substring from input going from index pos to the end. If pos >
86- * input.size(), it returns an empty string_view. This function cannot throw.
85+ * Return the substring from input going from index pos to the end.
86+ * This function cannot throw.
8787 */
8888ada_really_inline std::string_view substring (std::string_view input,
8989 size_t pos) noexcept ;
Original file line number Diff line number Diff line change @@ -106,9 +106,9 @@ ada_really_inline bool shorten_path(std::string& path,
106106 // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized
107107 // Windows drive letter, then return.
108108 if (type == ada::scheme::type::FILE &&
109- first_delimiter == std::string_view::npos) {
109+ first_delimiter == std::string_view::npos && !path. empty () ) {
110110 if (checkers::is_normalized_windows_drive_letter (
111- std::string_view (path. data () + 1 , first_delimiter - 1 ))) {
111+ helpers::substring (path, 1 ))) {
112112 return false ;
113113 }
114114 }
@@ -130,9 +130,9 @@ ada_really_inline bool shorten_path(std::string_view& path,
130130 // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized
131131 // Windows drive letter, then return.
132132 if (type == ada::scheme::type::FILE &&
133- first_delimiter == std::string_view::npos) {
133+ first_delimiter == std::string_view::npos && !path. empty () ) {
134134 if (checkers::is_normalized_windows_drive_letter (
135- std::string_view (path. data () + 1 , first_delimiter - 1 ))) {
135+ helpers::substring (path, 1 ))) {
136136 return false ;
137137 }
138138 }
You can’t perform that action at this time.
0 commit comments