cvs commit: ALFS/halfling/src halfling.c lib.c main.c tags.c

Mark Hymers markh at linuxfromscratch.org
Fri Oct 4 09:55:55 PDT 2002


Hi,

Hope this is alfs-discuss material

I've just been looking at these changes and I've possibly got the wrong
end of the stick here on all accounts so feel free to correct me..

On Thu, 03, Oct, 2002 at 04:41:35PM -0700, Jesse Tie-Ten-Quee spoke thus..
>        base = xmlGetProp(cur, "base");
>   +
>   +    if (base == NULL) {
>   +        base = strconcat("/", NULL);
>   +    }
>   +

Is that correct?  Surely if there is no base specified, it should
default to the pwd?

>        command = xmlGetProp(cur, "command");
>   +
>   +    if (command == NULL) {
>   +        command = strconcat(" ", NULL);
>   +    }
>   +

Wouldn't it be easier to drop out of the function in this case as
there's nothing to be executed (or is this [as is probably the case]
just a stop gap until you implement error handling?) 

And just one thing in execute:lib.c :

/*
	if (chdir(base)) {
	perror("chdir");
	return(1);
	}

	output = popen(cmd, "r");

	if (output == NULL) {
	perror("popen");
	return(1);
	}
	
	while (fgets(line, sizeof line, output) != NULL) {
	log("%s", line);
	}

	pclose(output);
*/

I don't quite understand why this is commented out?  I just tried it and
if you uncomment it, remove the error handling for base which was added
above and stick if (base) { } around the if(chdir(base) bit, it works
fine and doesn't segfault.

Am I missing something obvious?

Mark

-- 
Mark Hymers <markh at linuxfromscratch dot org>

"I never make predictions.  I never have and I never will."
     Tony Blair
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message



More information about the alfs-discuss mailing list