[ttssh2-commit] [9671] Revert r9669 "設定ファイルのあるフォルダの取得にAPIを使用するよう修正"

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2022年 1月 4日 (火) 00:34:10 JST


Revision: 9671
          https://osdn.net/projects/ttssh2/scm/svn/commits/9671
Author:   zmatsuo
Date:     2022-01-04 00:34:10 +0900 (Tue, 04 Jan 2022)
Log Message:
-----------
Revert r9669 "設定ファイルのあるフォルダの取得にAPIを使用するよう修正"

Revision Links:
--------------
    https://osdn.net/projects/ttssh2/scm/svn/commits/9669

Modified Paths:
--------------
    trunk/cygwin/cygterm/CMakeLists.txt
    trunk/cygwin/cygterm/cygterm.cc

-------------- next part --------------
Modified: trunk/cygwin/cygterm/CMakeLists.txt
===================================================================
--- trunk/cygwin/cygterm/CMakeLists.txt	2022-01-03 15:18:05 UTC (rev 9670)
+++ trunk/cygwin/cygterm/CMakeLists.txt	2022-01-03 15:34:10 UTC (rev 9671)
@@ -50,13 +50,6 @@
   -mwindows
   )
 
-target_link_libraries(
-  ${PACKAGE_NAME}
-  PRIVATE
-  shell32
-  ole32
-  )
-
 install(
   TARGETS ${PACKAGE_NAME}
   DESTINATION .

Modified: trunk/cygwin/cygterm/cygterm.cc
===================================================================
--- trunk/cygwin/cygterm/cygterm.cc	2022-01-03 15:18:05 UTC (rev 9670)
+++ trunk/cygwin/cygterm/cygterm.cc	2022-01-03 15:34:10 UTC (rev 9671)
@@ -51,15 +51,12 @@
 #include <sys/un.h>
 #include <sys/wait.h>
 #include <arpa/inet.h>
+#include <windows.h>
+#include <shlobj.h>
 #include <pwd.h>
 #include <sys/select.h>
 #include <wchar.h>
 
-#include <windows.h>
-#include <shlobj.h>
-#define INITGUID
-#include <knownfolders.h>
-
 // pageant support (ssh-agent proxy)
 //----------------------------------
 #define AGENT_COPYDATA_ID 0x804e50ba
@@ -325,6 +322,8 @@
 // $APPDATA
 char *get_appdata_dir()
 {
+#if 0
+	// link error :-(
     wchar_t *home_pathW;
     SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, NULL, &home_pathW);
     convert_bsW(home_pathW);
@@ -331,6 +330,12 @@
     char *home_pathU8 = convert_utf8_from_wchar(home_pathW);
     CoTaskMemFree(home_pathW);
     return home_pathU8;
+#endif
+#if 1
+    char *appdata = strdup(getenv("APPDATA"));
+    convert_bs(appdata);
+    return appdata;
+#endif
 }
 
 void get_cfg_filenames(char **cfg_exe_full, char **cfg_appdata_full, char **cfg)


ttssh2-commit メーリングリストの案内
Back to archive index