[parted-devel] FYI, use progname module

Jim Meyering jim at meyering.net
Sun Jun 8 21:45:47 UTC 2008


"Frodo Baggins" <frodo.drogo at gmail.com> wrote:
> Are you sure this change is OK?
> Don't we need 'int main(int argc, char** argv)' in order to reference argv[0]?
>
> On Thu, Jun 5, 2008 at 12:56 PM, Jim Meyering <jim at meyering.net> wrote:
> ...
>> diff --git a/libparted/tests/disk.c b/libparted/tests/disk.c
>> index 020bdc0..cf69b00 100644
>> --- a/libparted/tests/disk.c
>> +++ b/libparted/tests/disk.c
>> @@ -6,6 +6,7 @@
>>  #include <parted/parted.h>
>>
>>  #include "common.h"
>> +#include "progname.h"
>>
>>  static char* temporary_disk;
>>
>> @@ -87,6 +88,7 @@ END_TEST
>>  int
>>  main (void)
>>  {
>> +        set_program_name (argv[0]); <============ We don't have an argv array if we use 'int main (void)'

Ouch!  Thanks for reporting that!

And I had even ensured that "make distcheck" passed.
Obviously insufficient ;-)

Plus there were link problems.
Fixed and cleaned up with these two change sets
I've just pushed.




More information about the parted-devel mailing list