@@ -710,14 +710,14 @@ pub struct ArgsOs {
710
710
/// passed as-is.
711
711
///
712
712
/// On glibc Linux systems, arguments are retrieved by placing a function in `.init_array`.
713
- /// Glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
713
+ /// glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
714
714
/// extension. This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it
715
715
/// does on macOS and Windows.
716
716
///
717
717
/// # Panics
718
718
///
719
719
/// The returned iterator will panic during iteration if any argument to the
720
- /// process is not valid unicode . If this is not desired,
720
+ /// process is not valid Unicode . If this is not desired,
721
721
/// use the [`args_os`] function instead.
722
722
///
723
723
/// # Examples
@@ -735,17 +735,25 @@ pub fn args() -> Args {
735
735
Args { inner : args_os ( ) }
736
736
}
737
737
738
- /// Returns the arguments which this program was started with (normally passed
738
+ /// Returns the arguments that this program was started with (normally passed
739
739
/// via the command line).
740
740
///
741
741
/// The first element is traditionally the path of the executable, but it can be
742
- /// set to arbitrary text, and it may not even exist, so this property should
742
+ /// set to arbitrary text, and may not even exist. This means this property should
743
743
/// not be relied upon for security purposes.
744
744
///
745
- /// On glibc Linux systems, arguments are retrieved by placing a function in ".init_array".
746
- /// Glibc passes argc, argv, and envp to functions in ".init_array", as a non-standard extension.
747
- /// This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it does on macOS
748
- /// and Windows.
745
+ /// On Unix systems the shell usually expands unquoted arguments with glob patterns
746
+ /// (such as `*` and `?`). On Windows this is not done, and such arguments are
747
+ /// passed as-is.
748
+ ///
749
+ /// On glibc Linux systems, arguments are retrieved by placing a function in `.init_array`.
750
+ /// glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard
751
+ /// extension. This allows `std::env::args_os` to work even in a `cdylib` or `staticlib`, as it
752
+ /// does on macOS and Windows.
753
+ ///
754
+ /// Note that the returned iterator will not check if the arguments to the
755
+ /// process are valid Unicode. To ensure UTF-8 validity,
756
+ /// use the [`args`] function instead.
749
757
///
750
758
/// # Examples
751
759
///
0 commit comments