* Add enclair_db option to UserDB.pm. Allows logging of enclair password
[interchange.git] / code / OrderCheck / relative_filename.oc
1 # Copyright 2005-2007 Interchange Development Group and others
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.  See the LICENSE file for details.
7
8 # $Id: relative_filename.oc,v 1.3 2007-03-30 23:40:48 pajamian Exp $
9
10 CodeDef relative_filename OrderCheck 1
11 CodeDef relative_filename Description Relative filename
12 CodeDef relative_filename Routine <<EOR
13 sub {
14         my ($ref, $name, $value, $code) = @_;
15
16         if ($value =~ /\S/ && $value !~ /^\.{1,2}$/ 
17                 && ! Vend::File::absolute_or_relative($value)) {
18                 return (1, $name, '');
19         } else {
20                 $code ||= errmsg('filename not relative');
21                 return (0, $name, $code);
22         }
23 }
24 EOR