# HG changeset patch # User Markus Mützel # Date 1654294375 -7200 # Node ID 74d97efb75739076866112febe76fa47161040b8 # Parent 451fb63a10a018553a53583b49a65dd0c3522275# Parent d33af4594440e67ef1f35e9919f2f4bd824701a5 maint: Merge stable to default. diff -r 451fb63a10a0 -r 74d97efb7573 etc/NEWS.7.md --- a/etc/NEWS.7.md Thu Jun 02 19:56:15 2022 -0400 +++ b/etc/NEWS.7.md Sat Jun 04 00:12:55 2022 +0200 @@ -47,7 +47,7 @@ ### Documentation -- Fix minor typo in datestr.m. +- `datestr.m`: Fix minor typo. - `ls.m`: Improve wording in docstring (bug #62282). - `dir.m`: Clarify wildcard behavior on Windows in docstring (bug #62282). - `memory.m`: Redo documentation to be formatted correctly in Info output. @@ -148,17 +148,19 @@ between these operators and the variable they affect were allowed. That is no longer the case. -- For compatibility with command syntax, inplace operators (`+=`, `-=`, -`*=`, `.*=`, `/=`, `./=`, `\=`, `.\=`, `^=`, `.^=`, `|=`, `&=`) must now -either be followed by a whitespace character or must not be preceded by a -whitespace character. For commands with binary operators (`+`, `-`, `*`, - `.*`, `/`, `./`, `\`, `.\`, `^`, `.^`, `|`, `&`, `||`, `&&`) without -assignment, the same rules apply. That was not a requirement in previous -versions of Octave. -E.g., `a + b`, `a+ b`, or `a+b` are valid if `a` is a variable. In -contrast, `a +b` will throw an error if `a` is a variable. The latter -example is now interpreted as command syntax expression equivalent to the -function syntax expression `a ("+b")`. +- When an expression involving operators could be interpreted ambiguously +either as command style syntax or function style syntax, it is +interpreted as command style syntax in more cases than in previous +versions. To still be interpreted as function style syntax, inplace +operators (`+=`, `-=`, `*=`, `.*=`, `/=`, `./=`, `\=`, `.\=`, `^=`, +`.^=`, `|=`, `&=`) must now either be followed by a whitespace character +or must not be preceded by a whitespace character. For ambiguous +expressions involving binary operators (`+`, `-`, `*`, `.*`, `/`, `./`, +`\`, `.\`, `^`, `.^`, `|`, `&`, `||`, `&&`), the same rules apply. +E.g., `a + b`, `a+ b`, or `a+b` are valid expressions if `a` is a +variable. In contrast, `a +b` will throw an error if `a` is a variable. +The latter example is now interpreted as a command syntax expression +(equivalent to the function syntax expression `a ("+b")`). - The `mldivide` function (i.e., the `\` operator) now uses an LU decomposition to solve nearly singular full square matrices. This is diff -r 451fb63a10a0 -r 74d97efb7573 liboctave/util/oct-glob.cc --- a/liboctave/util/oct-glob.cc Thu Jun 02 19:56:15 2022 -0400 +++ b/liboctave/util/oct-glob.cc Sat Jun 04 00:12:55 2022 +0200 @@ -253,15 +253,33 @@ if (xpat.empty ()) continue; + std::string dir = ""; + // separate component until first file separator std::size_t sep_pos = xpat.find_first_of (sys::file_ops::dir_sep_chars ()); + + // handle UNC paths + if (sep_pos == 0 && xpat.length () > 1 + && sys::file_ops::is_dir_sep (xpat[1])) + { + // start pattern with a file, i.e., "\\SERVER\share\file" + sep_pos = xpat.find_first_of (sys::file_ops::dir_sep_chars (), 2); + if (sep_pos != std::string::npos) + sep_pos = xpat.find_first_of (sys::file_ops::dir_sep_chars (), + sep_pos + 1); + if (sep_pos != std::string::npos) + { + dir = xpat.substr(0, sep_pos); + xpat = xpat.substr (sep_pos+1); + sep_pos = xpat.find_first_of (sys::file_ops::dir_sep_chars ()); + } + } + std::string file = (sep_pos != std::string::npos) ? xpat.substr (sep_pos) : ""; xpat = xpat.substr (0, sep_pos); - std::string dir = ""; - if ((sep_pos == 2 || xpat.length () == 2) && xpat[1] == ':') { // include disc root with first file or folder