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

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


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)) {

	output = popen(cmd, "r");

	if (output == NULL) {
	while (fgets(line, sizeof line, output) != NULL) {
	log("%s", line);


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 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
and put 'unsubscribe alfs-discuss' in the subject header of the message

More information about the alfs-discuss mailing list