aboutsummaryrefslogtreecommitdiff
path: root/progs/toe.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2011-04-30 10:55:14 +0000
committerEd Schouten <ed@FreeBSD.org>2011-04-30 10:55:14 +0000
commit0294a182a1629b1d854b84906e73487d6cb75fba (patch)
treee563e21bcc0164ba11452983316bda26eebb1d3c /progs/toe.c
parent22b11c4db16996bf8d4878fab98762c348676df3 (diff)
downloadsrc-0294a182a1629b1d854b84906e73487d6cb75fba.tar.gz
src-0294a182a1629b1d854b84906e73487d6cb75fba.zip
Import a stock copy of ncurses 5.8 into the vendor space.vendor/ncurses/5.8-20110226
It seems both local changes we made to 5.7 have already been fixed upstream properly, so there is no need to preserve the changes. Also, with SVN we import full source trees. Unlike CVS, where we removed unneeded cruft.
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=221243 svn path=/vendor/ncurses/5.8-20110226/; revision=221244; tag=vendor/ncurses/5.8-20110226
Diffstat (limited to 'progs/toe.c')
-rw-r--r--progs/toe.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/progs/toe.c b/progs/toe.c
index 8af6f371b77b..6f45992f7124 100644
--- a/progs/toe.c
+++ b/progs/toe.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -44,7 +44,7 @@
#include <hashed_db.h>
#endif
-MODULE_ID("$Id: toe.c,v 1.51 2008/08/16 21:53:25 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.52 2010/05/01 22:04:08 tom Exp $")
#define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
@@ -61,6 +61,13 @@ ExitProgram(int code)
}
#endif
+static void
+failed(const char *msg)
+{
+ perror(msg);
+ ExitProgram(EXIT_FAILURE);
+}
+
#if USE_HASHED_DB
static bool
make_db_name(char *dst, const char *src, unsigned limit)
@@ -184,10 +191,10 @@ typelist(int eargc, char *eargv[],
DIRENT *entry;
cwd_buf = typeRealloc(char, cwd_len, cwd_buf);
- if (cwd_buf == 0) {
- perror("realloc cwd_buf");
- continue;
- }
+ if (cwd_buf == 0)
+ failed("realloc cwd_buf");
+
+ assert(cwd_buf != 0);
strncpy(name_1, subdir->d_name, len)[len] = '\0';
if (isDotname(name_1))
@@ -480,6 +487,10 @@ main(int argc, char *argv[])
}
if (!pass) {
eargv = typeCalloc(char *, count + 1);
+ if (eargv == 0)
+ failed("realloc eargv");
+
+ assert(eargv != 0);
} else {
code = typelist((int) count, eargv, header, deschook);
while (count-- > 0)