Skip to content

Commit

Permalink
Fixed parse_uri_to_local_file definition
Browse files Browse the repository at this point in the history
* Move to header file so it can be included in test case
* Declare static if not building for tests
  • Loading branch information
akallabeth committed Sep 21, 2022
1 parent 29794fb commit 650dab7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 1 addition & 5 deletions winpr/libwinpr/clipboard/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,7 @@ static BOOL is_dos_driver(const char* path, size_t len)
return FALSE;
}

#if !defined(BUILD_TESTING)
static
#endif
char*
parse_uri_to_local_file(const char* uri, size_t uri_len)
char* parse_uri_to_local_file(const char* uri, size_t uri_len)
{
// URI is specified by RFC 8089: https://datatracker.ietf.org/doc/html/rfc8089
const char prefix[] = "file:";
Expand Down
7 changes: 7 additions & 0 deletions winpr/libwinpr/clipboard/posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
#ifndef WINPR_CLIPBOARD_POSIX_H
#define WINPR_CLIPBOARD_POSIX_H

#include <winpr/config.h>
#include <winpr/clipboard.h>

BOOL ClipboardInitPosixFileSubsystem(wClipboard* clipboard);

#if !defined(BUILD_TESTING)
static
#endif
char*
parse_uri_to_local_file(const char* uri, size_t uri_len);

#endif /* WINPR_CLIPBOARD_POSIX_H */
4 changes: 2 additions & 2 deletions winpr/libwinpr/clipboard/test/TestUri.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#include <winpr/winpr.h>
#include "winpr/wlog.h"

#include "../posix.h"

#define WINPR_TAG(tag) "com.winpr." tag
#define TAG WINPR_TAG("clipboard.posix")

char* parse_uri_to_local_file(const char* uri, size_t uri_len);

int TestUri(int argc, char* argv[])
{
int nRet = 0;
Expand Down

0 comments on commit 650dab7

Please sign in to comment.