MCPcopy Create free account
hub / github.com/NetHack/NetHack / early_version_info

Function early_version_info

src/version.c:279–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279void
280early_version_info(boolean pastebuf)
281{
282 char buf1[BUFSZ], buf2[BUFSZ];
283 char *buf, *tmp;
284
285 Snprintf(buf1, sizeof buf1, "test");
286 /* this is early enough that we have to do our own line-splitting */
287 getversionstring(buf1, sizeof buf1);
288 tmp = strstri(buf1, " ("); /* split at start of version info */
289 if (tmp) {
290 /* retain one buffer so that it all goes into the paste buffer */
291 *tmp++ = '\0';
292 Snprintf(buf2, sizeof (buf2),"%s\n%s", buf1, tmp);
293 buf = buf2;
294 } else {
295 buf = buf1;
296 }
297
298 raw_printf("%s", buf);
299
300 if (pastebuf) {
301#if defined(RUNTIME_PASTEBUF_SUPPORT) && !defined(LIBNH)
302 /*
303 * Call a platform/port-specific routine to insert the
304 * version information into a paste buffer. Useful for
305 * easy inclusion in bug reports.
306 */
307 port_insert_pastebuf(buf);
308#else
309 raw_printf("%s", "Paste buffer copy is not available.\n");
310#endif
311 }
312}
313
314extern const char regex_id[];
315

Callers 1

argcheckFunction · 0.85

Calls 4

getversionstringFunction · 0.85
strstriFunction · 0.85
raw_printfFunction · 0.70
port_insert_pastebufFunction · 0.50

Tested by

no test coverage detected