File: configfile.patch

package info (click to toggle)
bcpp 0.0.20210108-1.1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 952 kB
  • sloc: cpp: 4,955; sh: 3,262; makefile: 237
file content (25 lines) | stat: -rw-r--r-- 990 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Index: bcpp-20180401/code/bcpp.cpp
===================================================================
--- bcpp-20180401.orig/code/bcpp.cpp
+++ bcpp-20180401/code/bcpp.cpp
@@ -159,6 +159,8 @@
 #include <time.h>              // time()
 #include <string.h>            // strlen(), strstr(), strchr(), strcpy(), strcmp()
 #include <ctype.h>             // character-types
+#include <unistd.h>            // getcwd()
+#include <limits.h>            // PATH_MAX
 
 #include "cmdline.h"           // ProcessCommandLine()
 #include "bcpp.h"
@@ -3563,7 +3565,11 @@ static void FindConfigFile (const char*
 {
     // test to see if file is in current directory first: ./bcpp.cfg
     if ((pCfgFile = fopen(pCfgName, "r")) != NULL)
+    {
+        char buf[PATH_MAX];
+        fprintf(stderr, "Using configuration file at \"%s/%s\"\n", getcwd(buf, sizeof(buf)), pCfgName);
         return;
+     }
 
     // search in user's $HOME directory: $HOME/.bcpp.cfg
     char* pSHome      = getenv ("HOME");