Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Utils
KWSys
Commits
cc2ac169
Commit
cc2ac169
authored
18 years ago
by
Brad King
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Adding support for # escape in Watcom WMake.
parent
dce24e45
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
System.c
+31
-4
31 additions, 4 deletions
System.c
System.h.in
+6
-1
6 additions, 1 deletion
System.h.in
with
37 additions
and
5 deletions
System.c
+
31
−
4
View file @
cc2ac169
...
...
@@ -222,7 +222,7 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in,
}
}
/* Check whether this character needs escaping. */
/* Check whether this character needs escaping
for the shell
. */
if
(
isUnix
)
{
/* On Unix a few special characters need escaping even inside a
...
...
@@ -261,7 +261,7 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in,
}
}
/*
T
he
dollar sign needs special handling in some environments
. */
/*
C
he
ck whether this character needs escaping for a make tool
. */
if
(
*
c
==
'$'
)
{
if
(
flags
&
kwsysSystem_Shell_Flag_Make
)
...
...
@@ -277,6 +277,16 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in,
size
+=
2
;
}
}
else
if
(
*
c
==
'#'
)
{
if
((
flags
&
kwsysSystem_Shell_Flag_Make
)
&&
(
flags
&
kwsysSystem_Shell_Flag_WatcomWMake
))
{
/* In Watcom WMake makefiles a pound is written $# so we need
one extra character. */
++
size
;
}
}
}
/* Check whether the argument needs surrounding quotes. */
...
...
@@ -333,7 +343,7 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out,
}
}
/* Check whether this character needs escaping. */
/* Check whether this character needs escaping
for the shell
. */
if
(
isUnix
)
{
/* On Unix a few special characters need escaping even inside a
...
...
@@ -377,7 +387,7 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out,
}
}
/*
T
he
dollar sign needs special handling in some environments
. */
/*
C
he
ck whether this character needs escaping for a make tool
. */
if
(
*
c
==
'$'
)
{
if
(
flags
&
kwsysSystem_Shell_Flag_Make
)
...
...
@@ -405,6 +415,23 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out,
*
out
++
=
'$'
;
}
}
else
if
(
*
c
==
'#'
)
{
if
((
flags
&
kwsysSystem_Shell_Flag_Make
)
&&
(
flags
&
kwsysSystem_Shell_Flag_WatcomWMake
))
{
/* In Watcom WMake makefiles a pound is written $#. The make
tool will replace it with just # before passing it to the
shell. */
*
out
++
=
'$'
;
*
out
++
=
'#'
;
}
else
{
/* Otherwise a pound is written just #. */
*
out
++
=
'#'
;
}
}
else
{
/* Store this character. */
...
...
This diff is collapsed.
Click to expand it.
System.h.in
+
6
−
1
View file @
cc2ac169
...
...
@@ -32,6 +32,7 @@
#define kwsysSystem_Shell_Flag_Make kwsys_ns(System_Shell_Flag_Make)
#define kwsysSystem_Shell_Flag_VSIDE kwsys_ns(System_Shell_Flag_VSIDE)
#define kwsysSystem_Shell_Flag_EchoWindows kwsys_ns(System_Shell_Flag_EchoWindows)
#define kwsysSystem_Shell_Flag_WatcomWMake kwsys_ns(System_Shell_Flag_WatcomWMake)
#define kwsysSystem_Shell_Flag_AllowMakeVariables kwsys_ns(System_Shell_Flag_AllowMakeVariables)
#if defined(__cplusplus)
...
...
@@ -82,12 +83,15 @@ enum kwsysSystem_Shell_Flag_e
/** In a windows whell the argument is being passed to "echo". */
kwsysSystem_Shell_Flag_EchoWindows = (1<<2),
/** The target shell is in a Watcom WMake makefile. */
kwsysSystem_Shell_Flag_WatcomWMake = (1<<3),
/** Make variable reference syntax $(MAKEVAR) should not be escaped
to allow a build tool to replace it. Replacement values
containing spaces, quotes, backslashes, or other
non-alphanumeric characters that have significance to some makes
or shells produce undefined behavior. */
kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<
3
)
kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<
4
)
};
#if defined(__cplusplus)
...
...
@@ -107,6 +111,7 @@ enum kwsysSystem_Shell_Flag_e
# undef kwsysSystem_Shell_Flag_Make
# undef kwsysSystem_Shell_Flag_VSIDE
# undef kwsysSystem_Shell_Flag_EchoWindows
# undef kwsysSystem_Shell_Flag_WatcomWMake
# undef kwsysSystem_Shell_Flag_AllowMakeVariables
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment