# HG changeset patch # User jwe # Date 1199732062 0 # Node ID a16658ac8eb99eee2f304afeaf4ae01d356c6cbb # Parent fd4eb4f95bb4919b1426f2d15108f014020cf873 [3-0-0-branch @ 2008-01-07 18:54:22 by jwe] diff -r fd4eb4f95bb4 -r a16658ac8eb9 scripts/ChangeLog --- a/scripts/ChangeLog Mon Jan 07 18:04:06 2008 +0000 +++ b/scripts/ChangeLog Mon Jan 07 18:54:22 2008 +0000 @@ -1,3 +1,8 @@ +2008-01-07 John W. Eaton + + * miscellaneous/copyfile.m, miscellaneous/movefile.m: + Error if glob call fails to match any files. + 2008-01-04 Thomas Treichl * strings/strtrim.m: Doc fix. diff -r fd4eb4f95bb4 -r a16658ac8eb9 scripts/miscellaneous/copyfile.m --- a/scripts/miscellaneous/copyfile.m Mon Jan 07 18:04:06 2008 +0000 +++ b/scripts/miscellaneous/copyfile.m Mon Jan 07 18:54:22 2008 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2005, 2006, 2007 John W. Eaton +## Copyright (C) 2005, 2006, 2007, 2008 John W. Eaton ## ## This file is part of Octave. ## @@ -76,6 +76,9 @@ ## Protect the file name(s). f1 = glob (f1); + if (isempty (f1)) + error ("copyfile: no files to move"); + endif p1 = sprintf ("\"%s\" ", f1{:}); p2 = tilde_expand (f2); diff -r fd4eb4f95bb4 -r a16658ac8eb9 scripts/miscellaneous/movefile.m --- a/scripts/miscellaneous/movefile.m Mon Jan 07 18:04:06 2008 +0000 +++ b/scripts/miscellaneous/movefile.m Mon Jan 07 18:54:22 2008 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2005, 2006, 2007 John W. Eaton +## Copyright (C) 2005, 2006, 2007, 2008 John W. Eaton ## ## This file is part of Octave. ## @@ -75,6 +75,9 @@ ## Protect the file name(s). f1 = glob (f1); + if (isempty (f1)) + error ("movefile: no files to move"); + endif p1 = sprintf ("\"%s\" ", f1{:}); p2 = tilde_expand (f2);