<div class="gmail_quote">2012/4/9 Robert Haas <span dir="ltr"><<a
href="mailto:robertmhaas@gmail.com">robertmhaas@gmail.com</a>></span><br/><blockquote class="gmail_quote"
style="margin:00 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Apr 9, 2012 at 7:38 AM,
CloverWhite <<a href="mailto:mywhiteclover@gmail.com">mywhiteclover@gmail.com</a>> wrote:<br /> > Hi,<br />
> I'm debugging initdb using gdb.<br /> > I found that I could not step in the function getopt_long in line
2572in<br /> > initdb.c.<br /> > I also found that the value of VAR optind never be changed. VAR optind is<br
/>> always equal to 1 but how could optind be larger than the value of argc(the<br /> > value of argc is 6) in
line2648 and 2654.<br /><br /></div>Read the man page for getopt_long. It changes the global variable optind.<br /><br
/>It's a silly interface, but also a long and hallowed UNIX tradition,<br /> so we're stuck with it.<br /><font
color="#888888"><br/> --<br /> Robert Haas<br /> EnterpriseDB: <a href="http://www.enterprisedb.com"
target="_blank">http://www.enterprisedb.com</a><br/> The Enterprise PostgreSQL Company<br
/></font></blockquote></div><br/>Thanks Robert. I have read the man page for getopt_long and optind. they are in the
sameman page.<br /><br />but i still could not understand why optind always equal to 1 when I gdb initdb and print
optind?<br/> Was optind supported to increased after getopt_long pasered every parameter?<br clear="all" /><br />--
<br/>Clover White<br /><br />