* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-revoke.c,v 1.5 2009/07/19 04:18:04 each Exp $ */
+/* $Id: dnssec-revoke.c,v 1.6 2009/07/19 05:26:05 each Exp $ */
/*! \file */
#endif
dir = strdup(argv[isc_commandline_index]);
+ filename = dir;
/* Figure out the directory name from the key name */
slash = strrchr(dir, '/');
(slash == NULL && backslash != NULL))
slash = backslash;
#endif
- if (slash != NULL)
+ if (slash != NULL) {
*slash++ = '\0';
- else {
+ filename = slash;
+ } else {
free(dir);
dir = strdup(".");
}
}
- filename = argv[isc_commandline_index];
-
if (ectx == NULL)
setup_entropy(mctx, NULL, &ectx);
result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-settime.c,v 1.3 2009/07/19 05:06:48 each Exp $ */
+/* $Id: dnssec-settime.c,v 1.4 2009/07/19 05:26:05 each Exp $ */
/*! \file */
if (argc > isc_commandline_index + 1)
fatal("Extraneous arguments");
- if (directory == NULL)
- directory = dirname(argv[isc_commandline_index]);
- filename = basename(argv[isc_commandline_index]);
+ if (directory == NULL) {
+ char *slash;
+#ifdef _WIN32
+ char *backslash;
+#endif
+
+ directory = strdup(argv[isc_commandline_index]);
+ filename = directory;
+
+ /* Figure out the directory name from the key name */
+ slash = strrchr(directory, '/');
+#ifdef _WIN32
+ backslash = strrchr(directory, '\\');
+ if ((slash != NULL && backslash != NULL && backslash > slash) ||
+ (slash == NULL && backslash != NULL))
+ slash = backslash;
+#endif
+ if (slash != NULL) {
+ *slash++ = '\0';
+ filename = slash;
+ } else {
+ free(directory);
+ directory = strdup(".");
+ }
+ }
+
+ filename = argv[isc_commandline_index];
if (ectx == NULL)
setup_entropy(mctx, NULL, &ectx);