util.c revision 99ebb4ca412cb0a19d77a3899a87c055b9c30fa8
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER START
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The contents of this file are subject to the terms of the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Common Development and Distribution License (the "License").
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You may not use this file except in compliance with the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
843e19887f64dde75055cf8842fc4db2171eff45johnlev * See the License for the specific language governing permissions
843e19887f64dde75055cf8842fc4db2171eff45johnlev * and limitations under the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * When distributing Covered Code, include this CDDL HEADER in each
843e19887f64dde75055cf8842fc4db2171eff45johnlev * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * If applicable, add the following below this CDDL HEADER, with the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * fields enclosed by brackets "[]" replaced with your own identifying
843e19887f64dde75055cf8842fc4db2171eff45johnlev * information: Portions Copyright [yyyy] [name of copyright owner]
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER END
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * Use is subject to license terms.
843e19887f64dde75055cf8842fc4db2171eff45johnlev#pragma ident "%Z%%M% %I% %E% SMI"
843e19887f64dde75055cf8842fc4db2171eff45johnlev * This function returns a fullpath based on the "dir" and "filepath" input
843e19887f64dde75055cf8842fc4db2171eff45johnlev * arugments.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * - If the filepath specified does not start with a "/" and the directory
843e19887f64dde75055cf8842fc4db2171eff45johnlev * is also given, prepend the directory to the filename.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * - If only dir or filepath is given, this function returns a copy of the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * given argument.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * - If the filepath is fully qualified already and the "dir" is also
843e19887f64dde75055cf8842fc4db2171eff45johnlev * given, return NULL to indicate an error.
843e19887f64dde75055cf8842fc4db2171eff45johnlev } else if (pathlen > 0) {
} else if (dirlen > 0) {
return (fullpath);
int num;
*ltime = 0;
*ltime = 0;