forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit980a70b
committed
Fix our getopt_long's behavior for a command line argument of just "-".
src/port/getopt_long.c failed on such an argument, always seeing itas an unrecognized switch. This is unhelpful; better is to treat suchan item as a non-switch argument. That behavior is what we find inGNU's getopt_long(); it's what src/port/getopt.c does; and it isrequired by POSIX for getopt(), which getopt_long() ought to begenerally a superset of. Moreover, it's expected by ecpg, whichintends an argument of "-" to mean "read from stdin". So fix it.Also add some documentation about ecpg's behavior in this area, sincethat was miserably underdocumented. I had to reverse-engineer itfrom the code.Per bug #16304 from James Gray. Back-patch to all supported branches,since this has been broken forever.Discussion:https://postgr.es/m/16304-c662b00a1322db7f@postgresql.org1 parentc81bd3b commit980a70b
2 files changed
+37
-8
lines changedLines changed: 26 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
44 |
| - | |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 |
| - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 |
| |
53 | 60 |
| |
54 | 61 |
| |
| |||
94 | 101 |
| |
95 | 102 |
| |
96 | 103 |
| |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
97 | 117 |
| |
98 | 118 |
| |
99 | 119 |
| |
| |||
125 | 145 |
| |
126 | 146 |
| |
127 | 147 |
| |
| 148 | + | |
128 | 149 |
| |
129 | 150 |
| |
130 | 151 |
| |
|
Lines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
82 |
| - | |
83 |
| - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
84 | 92 |
| |
85 | 93 |
| |
86 | 94 |
| |
87 | 95 |
| |
88 | 96 |
| |
89 |
| - | |
| 97 | + | |
90 | 98 |
| |
91 | 99 |
| |
92 | 100 |
| |
|
0 commit comments
Comments
(0)