From 32928258cedefe07adefd90d253d02f91f2e3a6c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 5 Dec 2009 12:14:04 +0100 Subject: [PATCH] progname: Clarify specification. --- ChangeLog | 6 ++++++ lib/progname.c | 6 ++++-- lib/progname.h | 8 +++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ddf5204056..3c018093b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-12-05 Bruno Haible + + * lib/progname.h (set_program_name): Clarify specification. + * lib/progname.c (set_program_name): Likewise. + Reported by Jim Meyering. + 2009-12-05 Jim Meyering maint.mk: backslash-escape parens in default regexp diff --git a/lib/progname.c b/lib/progname.c index bfa374a528..c8660c9418 100644 --- a/lib/progname.c +++ b/lib/progname.c @@ -1,6 +1,6 @@ /* Program name management. Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc. - Written by Bruno Haible , 2001. + Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +30,9 @@ To be initialized by main(). */ const char *program_name = NULL; -/* Set program_name, based on argv[0]. */ +/* Set program_name, based on argv[0]. + argv0 must be a string allocated with indefinite extent, and must not be + modified after this call. */ void set_program_name (const char *argv0) { diff --git a/lib/progname.h b/lib/progname.h index 82615c6bc0..b223970f68 100644 --- a/lib/progname.h +++ b/lib/progname.h @@ -1,6 +1,6 @@ /* Program name management. - Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc. - Written by Bruno Haible , 2001. + Copyright (C) 2001-2004, 2006, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,9 @@ extern "C" { /* String containing name the program is called with. */ extern const char *program_name; -/* Set program_name, based on argv[0]. */ +/* Set program_name, based on argv[0]. + argv0 must be a string allocated with indefinite extent, and must not be + modified after this call. */ extern void set_program_name (const char *argv0); #if ENABLE_RELOCATABLE -- 2.30.2