summaryrefslogtreecommitdiff
path: root/src/load.c
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2019-04-13 13:54:00 -0400
committerFelipe Sateler <fsateler@debian.org>2019-04-13 13:54:00 -0400
commit7f00614eb2add32d97bbb0ab47ac5b6322238e87 (patch)
treede98d4a4ec82eba3d0e1998473cb15a61e44eb2b /src/load.c
parentb7c12c1360bffb758667af95e6ddcf6f2a9758fa (diff)
parent34b181465b17c6460e055f89d9ad1b47d4517a1b (diff)
Update upstream source from tag 'upstream/1.15'
Update to upstream version '1.15' with Debian dir 3b217fcd63314f946cb36492e0b85e7328ada240
Diffstat (limited to 'src/load.c')
-rw-r--r--src/load.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/src/load.c b/src/load.c
index c2a5aa7..fb0bca0 100644
--- a/src/load.c
+++ b/src/load.c
@@ -53,37 +53,36 @@ dlopenLADSPA(const char * pcFilename, int iFlag) {
LD_LIBRARY_PATH, whereas the LADSPA_PATH is the correct place
to search. */
- pcLADSPAPath = getenv("LADSPA_PATH");
-
- if (pcLADSPAPath) {
-
- pcStart = pcLADSPAPath;
- while (*pcStart != '\0') {
- pcEnd = pcStart;
- while (*pcEnd != ':' && *pcEnd != '\0')
- pcEnd++;
-
- pcBuffer = malloc(iFilenameLength + 2 + (pcEnd - pcStart));
- if (pcEnd > pcStart)
- strncpy(pcBuffer, pcStart, pcEnd - pcStart);
- iNeedSlash = 0;
- if (pcEnd > pcStart)
- if (*(pcEnd - 1) != '/') {
- iNeedSlash = 1;
- pcBuffer[pcEnd - pcStart] = '/';
- }
- strcpy(pcBuffer + iNeedSlash + (pcEnd - pcStart), pcFilename);
-
- pvResult = dlopen(pcBuffer, iFlag);
-
- free(pcBuffer);
- if (pvResult != NULL)
- return pvResult;
-
- pcStart = pcEnd;
- if (*pcStart == ':')
- pcStart++;
- }
+ pcLADSPAPath = getenv("LADSPA_PATH");
+ if (pcLADSPAPath == NULL)
+ pcLADSPAPath = EXPAND_AND_STRINGIFY(DEFAULT_LADSPA_PATH);
+
+ pcStart = pcLADSPAPath;
+ while (*pcStart != '\0') {
+ pcEnd = pcStart;
+ while (*pcEnd != ':' && *pcEnd != '\0')
+ pcEnd++;
+
+ pcBuffer = malloc(iFilenameLength + 2 + (pcEnd - pcStart));
+ if (pcEnd > pcStart)
+ strncpy(pcBuffer, pcStart, pcEnd - pcStart);
+ iNeedSlash = 0;
+ if (pcEnd > pcStart)
+ if (*(pcEnd - 1) != '/') {
+ iNeedSlash = 1;
+ pcBuffer[pcEnd - pcStart] = '/';
+ }
+ strcpy(pcBuffer + iNeedSlash + (pcEnd - pcStart), pcFilename);
+
+ pvResult = dlopen(pcBuffer, iFlag);
+
+ free(pcBuffer);
+ if (pvResult != NULL)
+ return pvResult;
+
+ pcStart = pcEnd;
+ if (*pcStart == ':')
+ pcStart++;
}
}