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

Function copy_symbols_content

sys/windows/windmain.c:755–795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755void
756copy_symbols_content(void)
757{
758 char dst_path[MAX_PATH], interim_path[MAX_PATH], orig_path[MAX_PATH];
759
760 boolean no_template = FALSE;
761
762 /* Using the SYSCONFPREFIX path, lock it so that it does not change */
763 fqn_prefix_locked[SYSCONFPREFIX] = TRUE;
764
765 strcpy(orig_path, gf.fqn_prefix[DATAPREFIX]);
766 strcat(orig_path, SYMBOLS_TEMPLATE);
767 strcpy(interim_path, gf.fqn_prefix[SYSCONFPREFIX]);
768 strcat(interim_path, SYMBOLS_TEMPLATE);
769 strcpy(dst_path, gf.fqn_prefix[SYSCONFPREFIX]);
770 strcat(dst_path, SYMBOLS);
771
772 if (!file_exists(orig_path)) {
773 char alt_orig_path[MAX_PATH];
774
775 strcpy(alt_orig_path, gf.fqn_prefix[DATAPREFIX]);
776 strcat(alt_orig_path, SYMBOLS);
777 if (file_exists(alt_orig_path)) {
778 no_template = TRUE;
779 /* <dist>symbols -> <dist>symbols.template */
780 copy_file(gf.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE,
781 gf.fqn_prefix[DATAPREFIX], SYMBOLS, TRUE);
782 }
783 }
784 if (!file_exists(interim_path) || file_newer(orig_path, interim_path)) {
785 /* <dist>symbols.template -> <playground>symbols.template */
786 copy_file(gf.fqn_prefix[SYSCONFPREFIX], SYMBOLS_TEMPLATE,
787 gf.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE, TRUE);
788 }
789 if (!file_exists(dst_path) || file_newer(interim_path, dst_path)) {
790 /* <playground>symbols.template -> <playground>symbols */
791 copy_file(gf.fqn_prefix[SYSCONFPREFIX], SYMBOLS,
792 gf.fqn_prefix[SYSCONFPREFIX], SYMBOLS_TEMPLATE, TRUE);
793 }
794 nhUse(no_template);
795}
796
797void
798copy_sysconf_content(void)

Callers 1

MAINFunction · 0.85

Calls 3

file_newerFunction · 0.85
file_existsFunction · 0.70
copy_fileFunction · 0.70

Tested by

no test coverage detected