void showversion(void)
{
- printf("puttygen: %s\n", ver);
+ char *buildinfo_text = buildinfo("\n");
+ printf("puttygen: %s\n%s", ver, buildinfo_text);
+ sfree(buildinfo_text);
}
void usage(int standalone)
size_t slen = strlen(s), tlen = strlen(t);
return slen >= tlen && !strcmp(s + (slen - tlen), t);
}
+
+char *buildinfo(const char *newline)
+{
+ strbuf *buf = strbuf_new();
+
+ strbuf_catf(buf, "Build platform: %d-bit %s",
+ (int)(CHAR_BIT * sizeof(void *)),
+ BUILDINFO_PLATFORM);
+
+#ifdef __clang_version__
+ strbuf_catf(buf, "%sCompiler: clang %s", newline, __clang_version__);
+#elif defined __GNUC__ && defined __VERSION__
+ strbuf_catf(buf, "%sCompiler: gcc %s", newline, __VERSION__);
+#elif defined _MSC_VER
+ strbuf_catf(buf, "%sCompiler: Visual Studio", newline);
+#if _MSC_VER == 1900
+ strbuf_catf(buf, " 2015 / MSVC++ 14.0");
+#elif _MSC_VER == 1800
+ strbuf_catf(buf, " 2013 / MSVC++ 12.0");
+#elif _MSC_VER == 1700
+ strbuf_catf(buf, " 2012 / MSVC++ 11.0");
+#elif _MSC_VER == 1600
+ strbuf_catf(buf, " 2010 / MSVC++ 10.0");
+#elif _MSC_VER == 1500
+ strbuf_catf(buf, " 2008 / MSVC++ 9.0");
+#elif _MSC_VER == 1400
+ strbuf_catf(buf, " 2005 / MSVC++ 8.0");
+#elif _MSC_VER == 1310
+ strbuf_catf(buf, " 2003 / MSVC++ 7.1");
+#else
+ strbuf_catf(buf, ", unrecognised version");
+#endif
+ strbuf_catf(buf, " (_MSC_VER=%d)", (int)_MSC_VER);
+#endif
+
+#ifdef NO_SECURITY
+ strbuf_catf(buf, "%sBuild option: NO_SECURITY", newline);
+#endif
+#ifdef NO_SECUREZEROMEMORY
+ strbuf_catf(buf, "%sBuild option: NO_SECUREZEROMEMORY", newline);
+#endif
+#ifdef NO_IPV6
+ strbuf_catf(buf, "%sBuild option: NO_IPV6", newline);
+#endif
+#ifdef NO_GSSAPI
+ strbuf_catf(buf, "%sBuild option: NO_GSSAPI", newline);
+#endif
+#ifdef STATIC_GSSAPI
+ strbuf_catf(buf, "%sBuild option: STATIC_GSSAPI", newline);
+#endif
+#ifdef UNPROTECT
+ strbuf_catf(buf, "%sBuild option: UNPROTECT", newline);
+#endif
+#ifdef FUZZING
+ strbuf_catf(buf, "%sBuild option: FUZZING", newline);
+#endif
+#ifdef DEBUG
+ strbuf_catf(buf, "%sBuild option: DEBUG", newline);
+#endif
+
+ return strbuf_to_str(buf);
+}
* form, check if it equals an ordinary C zero-terminated string. */
int match_ssh_id(int stringlen, const void *string, const char *id);
+char *buildinfo(const char *newline);
+
/*
* Debugging functions.
*
void version(void)
{
- printf("pscp: %s\n", ver);
+ char *buildinfo_text = buildinfo("\n");
+ printf("pscp: %s\n%s\n", ver, buildinfo_text);
+ sfree(buildinfo_text);
cleanup_exit(1);
}
static void version(void)
{
- printf("psftp: %s\n", ver);
+ char *buildinfo_text = buildinfo("\n");
+ printf("psftp: %s\n%s\n", ver, buildinfo_text);
+ sfree(buildinfo_text);
cleanup_exit(1);
}
gtk_widget_show(w);
{
+ char *buildinfo_text = buildinfo("\n");
char *label_text = dupprintf
- ("%s\n\n%s\n\n%s",
- appname, ver,
+ ("%s\n\n%s\n\n%s\n\n%s",
+ appname, ver, buildinfo_text,
"Copyright " SHORT_COPYRIGHT_DETAILS ". All rights reserved");
w = gtk_label_new(label_text);
gtk_label_set_justify(GTK_LABEL(w), GTK_JUSTIFY_CENTER);
}
static void version(FILE *fp) {
- if(fprintf(fp, "%s: %s\n", appname, ver) < 0 || fflush(fp) < 0) {
+ char *buildinfo_text = buildinfo("\n");
+ if(fprintf(fp, "%s: %s\n%s\n", appname, ver, buildinfo_text) < 0 ||
+ fflush(fp) < 0) {
perror("output error");
exit(1);
}
+ sfree(buildinfo_text);
}
static struct gui_data *the_inst;
#define META_MANUAL_MASK (GDK_MOD1_MASK)
#define JUST_USE_GTK_CLIPBOARD_UTF8 /* low-level gdk_selection_* fails */
#define DEFAULT_CLIPBOARD GDK_SELECTION_CLIPBOARD /* OS X has no PRIMARY */
+
+#define BUILDINFO_PLATFORM "OS X (GTK)"
+
+#elif defined NOT_X_WINDOWS
+
+#define BUILDINFO_PLATFORM "Unix (pure GTK)"
+
+#else
+
+#define BUILDINFO_PLATFORM "Unix (GTK + X11)"
+
#endif
struct Filename {
static void version(void)
{
- printf("pageant: %s\n", ver);
+ char *buildinfo_text = buildinfo("\n");
+ printf("pageant: %s\n%s\n", ver, buildinfo_text);
+ sfree(buildinfo_text);
exit(1);
}
static void version(void)
{
- printf("plink: %s\n", ver);
+ char *buildinfo_text = buildinfo("\n");
+ printf("plink: %s\n%s\n", ver, buildinfo_text);
+ sfree(buildinfo_text);
exit(1);
}
END
/* Accelerators used: cl */
-213 DIALOG DISCARDABLE 140, 40, 214, 74
+213 DIALOG DISCARDABLE 140, 40, 214, 90
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About Pageant"
FONT 8, "MS Shell Dlg"
BEGIN
- DEFPUSHBUTTON "&Close", IDOK, 160, 56, 48, 14
- PUSHBUTTON "View &Licence", 101, 6, 56, 70, 14
- EDITTEXT 1000, 10, 6, 194, 48, ES_READONLY | ES_MULTILINE | ES_CENTER, WS_EX_STATICEDGE
+ DEFPUSHBUTTON "&Close", IDOK, 160, 72, 48, 14
+ PUSHBUTTON "View &Licence", 101, 6, 72, 70, 14
+ EDITTEXT 1000, 10, 6, 194, 64, ES_READONLY | ES_MULTILINE | ES_CENTER, WS_EX_STATICEDGE
END
/* No accelerators used */
END
/* Accelerators used: cl */
-213 DIALOG DISCARDABLE 140, 40, 214, 74
+213 DIALOG DISCARDABLE 140, 40, 214, 90
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About PuTTYgen"
FONT 8, "MS Shell Dlg"
BEGIN
- DEFPUSHBUTTON "&Close", IDOK, 160, 56, 48, 14
- PUSHBUTTON "View &Licence", 101, 6, 56, 70, 14
- EDITTEXT 1000, 10, 6, 194, 48, ES_READONLY | ES_MULTILINE | ES_CENTER, WS_EX_STATICEDGE
+ DEFPUSHBUTTON "&Close", IDOK, 160, 72, 48, 14
+ PUSHBUTTON "View &Licence", 101, 6, 72, 70, 14
+ EDITTEXT 1000, 10, 6, 194, 64, ES_READONLY | ES_MULTILINE | ES_CENTER, WS_EX_STATICEDGE
END
/* No accelerators used */
IDI_CFGICON ICON "puttycfg.ico"
/* Accelerators used: clw */
-IDD_ABOUTBOX DIALOG DISCARDABLE 140, 40, 214, 74
+IDD_ABOUTBOX DIALOG DISCARDABLE 140, 40, 270, 106
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About PuTTY"
FONT 8, "MS Shell Dlg"
BEGIN
- DEFPUSHBUTTON "&Close", IDOK, 160, 56, 48, 14
- PUSHBUTTON "View &Licence", IDA_LICENCE, 6, 56, 70, 14
- PUSHBUTTON "Visit &Web Site", IDA_WEB, 84, 56, 70, 14
- EDITTEXT IDA_TEXT, 10, 6, 194, 48, ES_READONLY | ES_MULTILINE | ES_CENTER, WS_EX_STATICEDGE
+ DEFPUSHBUTTON "&Close", IDOK, 216, 88, 48, 14
+ PUSHBUTTON "View &Licence", IDA_LICENCE, 6, 88, 70, 14
+ PUSHBUTTON "Visit &Web Site", IDA_WEB, 140, 88, 70, 14
+ EDITTEXT IDA_TEXT, 10, 6, 250, 80, ES_READONLY | ES_MULTILINE | ES_CENTER, WS_EX_STATICEDGE
END
/* Accelerators used: aco */
SetWindowText(hwnd, str);
sfree(str);
{
+ char *buildinfo_text = buildinfo("\r\n");
char *text = dupprintf
- ("%s\r\n\r\n%s\r\n\r\n%s",
- appname, ver,
+ ("%s\r\n\r\n%s\r\n\r\n%s\r\n\r\n%s",
+ appname, ver, buildinfo_text,
"\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
+ sfree(buildinfo_text);
SetDlgItemText(hwnd, IDA_TEXT, text);
sfree(text);
}
}
{
+ char *buildinfo_text = buildinfo("\r\n");
char *text = dupprintf
- ("PuTTYgen\r\n\r\n%s\r\n\r\n%s",
- ver,
+ ("PuTTYgen\r\n\r\n%s\r\n\r\n%s\r\n\r\n%s",
+ ver, buildinfo_text,
"\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
+ sfree(buildinfo_text);
SetDlgItemText(hwnd, 1000, text);
sfree(text);
}
switch (msg) {
case WM_INITDIALOG:
{
+ char *buildinfo_text = buildinfo("\r\n");
char *text = dupprintf
- ("Pageant\r\n\r\n%s\r\n\r\n%s",
- ver,
+ ("Pageant\r\n\r\n%s\r\n\r\n%s\r\n\r\n%s",
+ ver, buildinfo_text,
"\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
+ sfree(buildinfo_text);
SetDlgItemText(hwnd, 1000, text);
sfree(text);
}
static void version(void)
{
- printf("plink: %s\n", ver);
+ char *buildinfo_text = buildinfo("\n");
+ printf("plink: %s\n%s\n", ver, buildinfo_text);
+ sfree(buildinfo_text);
exit(1);
}
#include "winhelp.h"
+#define BUILDINFO_PLATFORM "Windows"
+
struct Filename {
char *path;
};