diff options
author | Bruno Haible <bruno@clisp.org> | 2019-07-03 02:49:27 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-07-06 00:31:51 +0200 |
commit | d4239808ee9dc891219fd589ec2b120b3c201a34 (patch) | |
tree | de929df878286b991248b8d416b00821d2d3f276 /lib/at-func2.c | |
parent | 9ce9be2ef0cb1180e35dfe9dfbbe90d774b374bd (diff) | |
download | gnulib-d4239808ee9dc891219fd589ec2b120b3c201a34.tar.gz |
renameatu: Fix test failure on MSVC.
* lib/at-func2.c (at_func2): Fail with ENOENT if file1 or file2 is the
empty string.
Diffstat (limited to 'lib/at-func2.c')
-rw-r--r-- | lib/at-func2.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/at-func2.c b/lib/at-func2.c index eaa256cb1e..bb8792f6e1 100644 --- a/lib/at-func2.c +++ b/lib/at-func2.c @@ -176,6 +176,13 @@ at_func2 (int fd1, char const *file1, return func (file1, file2); /* Reduced to case 5. */ } + /* Catch invalid arguments before changing directories. */ + if (file1[0] == '\0' || file2[0] == '\0') + { + errno = ENOENT; + return -1; + } + /* Cases 3, 7, 12, 13, 15a, 15b remain. With all reductions in place, it is time to start changing directories. */ |