Skip to content

Commit

Permalink
- Remove dead variable assignments
Browse files Browse the repository at this point in the history
- Fix -x

Submitted by:	uqs
Approved by:	delphij (mentor)
  • Loading branch information
Gabor Kovesdan authored and Gabor Kovesdan committed Feb 3, 2010
1 parent 12360c4 commit 4ef0890
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions usr.bin/dc/bcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1620,11 +1620,9 @@ skipN(void)
static void
skip_until_mark(void)
{
int ch;

for (;;) {
ch = readch();
switch (ch) {
switch (readch()) {
case 'M':
return;
case EOF:
Expand All @@ -1649,7 +1647,7 @@ skip_until_mark(void)
free(read_string(&bmachine.readstack[bmachine.readsp]));
break;
case '!':
switch (ch = readch()) {
switch (readch()) {
case '<':
case '>':
case '=':
Expand Down
12 changes: 4 additions & 8 deletions usr.bin/dc/dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,8 @@ main(int argc, char *argv[])
{
int ch;
bool extended_regs = false;
char *buf;
bool preproc_done = false;

if ((buf = strdup("")) == NULL)
err(1, NULL);

init_bmachine(extended_regs);
setlinebuf(stdout);
setlinebuf(stderr);

/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) {
switch (ch) {
Expand Down Expand Up @@ -123,6 +115,10 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;

init_bmachine(extended_regs);
setlinebuf(stdout);
setlinebuf(stderr);

if (argc > 1)
usage();
if (argc == 1) {
Expand Down

0 comments on commit 4ef0890

Please sign in to comment.