X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cde%2Fprograms%2Fdtlogin%2Fqualify.c;h=9c743c729a833a46c495cfd431306ef6a299afad;hb=ee4c38da0ac91a0daf782706bf16faee1c409880;hp=4a079f880db43dc36a5a8b4fdcb578a8216cbaea;hpb=83b6996daa2c5ae22fc2b69093814cb08314954a;p=oweals%2Fcde.git diff --git a/cde/programs/dtlogin/qualify.c b/cde/programs/dtlogin/qualify.c index 4a079f88..9c743c72 100644 --- a/cde/programs/dtlogin/qualify.c +++ b/cde/programs/dtlogin/qualify.c @@ -1,3 +1,25 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these librararies and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ /* $XConsortium: qualify.c /main/3 1995/10/27 16:14:33 rswiston $ */ /* * * (c) Copyright 1993, 1994 Hewlett-Packard Company * @@ -7,6 +29,7 @@ */ #include #include +#include /********************************************************************* * qualifyWithFirst @@ -26,8 +49,8 @@ char * qualifyWithFirst char * searchPath ) { -char * paths = strdup(searchPath); -char * savepaths = paths; +char * paths = NULL; +char * savepaths = NULL; char * path; char * chance; FILE * f; @@ -37,6 +60,9 @@ FILE * f; if (filename == NULL || searchPath == NULL) return NULL; + paths = strdup(searchPath); + savepaths = paths; + while (1) { /* if there is a :, zero it */