diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index e882f40281a..6c93dce6939 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -837,8 +837,11 @@ impl<'a> Pager<'a> { // Determine progress information to display // - Show next file name when at EOF and there is a next file // - Otherwise show percentage of the file read (if available) - let progress_info = if self.eof_reached && self.next_file.is_some() { - format!(" (Next file: {})", self.next_file.unwrap()) + let progress_info = if self.eof_reached { + self.next_file + .as_ref() + .map(|next_file| format!(" (Next file: {next_file})")) + .unwrap_or_default() } else if let Some(file_size) = self.file_size { // For files, show percentage or END let position = self