Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ff67da43
Commit
ff67da43
authored
Apr 18, 2005
by
Ferenc Wagner
Committed by
Alexandre Julliard
Apr 18, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce valid tag syntax during input.
parent
05413fcc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
15 deletions
+37
-15
gui.c
programs/winetest/gui.c
+22
-6
main.c
programs/winetest/main.c
+1
-1
util.c
programs/winetest/util.c
+11
-6
winetest.h
programs/winetest/winetest.h
+2
-1
winetest.rc
programs/winetest/winetest.rc
+1
-1
No files found.
programs/winetest/gui.c
View file @
ff67da43
...
...
@@ -41,6 +41,8 @@ double progressScale;
*/
int
progressGroup
;
WNDPROC
DefEditProc
;
char
*
renderString
(
va_list
ap
)
{
...
...
@@ -319,21 +321,35 @@ guiAsk (va_list ap)
}
BOOL
CALLBACK
EditTagProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
case
WM_CHAR
:
if
(
wParam
==
8
)
break
;
/* backspace is OK */
if
(
GetWindowTextLengthA
(
hwnd
)
==
MAXTAGLEN
||
!
goodtagchar
(
wParam
))
return
TRUE
;
break
;
}
return
CallWindowProcA
(
DefEditProc
,
hwnd
,
msg
,
wParam
,
lParam
);
}
BOOL
CALLBACK
AskTagProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
int
len
;
switch
(
msg
)
{
case
WM_INITDIALOG
:
DefEditProc
=
(
WNDPROC
)
SetWindowLongPtr
(
GetDlgItem
(
hwnd
,
IDC_TAG
),
GWLP_WNDPROC
,
(
LONG_PTR
)
EditTagProc
);
return
TRUE
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
{
case
IDOK
:
len
=
GetWindowTextLengthA
(
GetDlgItem
(
hwnd
,
IDC_TAG
));
if
(
len
<=
MAXTAGLEN
)
{
tag
=
xmalloc
(
len
+
1
);
GetDlgItemTextA
(
hwnd
,
IDC_TAG
,
tag
,
len
+
1
);
if
(
!
badtagchar
(
tag
))
EndDialog
(
hwnd
,
IDOK
);
else
free
(
tag
);
}
tag
=
xmalloc
(
len
+
1
);
GetDlgItemTextA
(
hwnd
,
IDC_TAG
,
tag
,
len
+
1
);
EndDialog
(
hwnd
,
IDOK
);
return
TRUE
;
case
IDABORT
:
EndDialog
(
hwnd
,
IDABORT
);
...
...
programs/winetest/main.c
View file @
ff67da43
...
...
@@ -601,7 +601,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
if
(
strlen
(
tag
)
>
MAXTAGLEN
)
report
(
R_FATAL
,
"tag is too long (maximum %d characters)"
,
MAXTAGLEN
);
cp
=
badtagchar
(
tag
);
cp
=
find
badtagchar
(
tag
);
if
(
cp
)
{
report
(
R_ERROR
,
"invalid char in tag: %c"
,
*
cp
);
usage
();
...
...
programs/winetest/util.c
View file @
ff67da43
...
...
@@ -104,15 +104,20 @@ void xprintf (const char *fmt, ...)
free
(
buffer
);
}
int
goodtagchar
(
char
c
)
{
return
((
'a'
<=
c
&&
c
<=
'z'
)
||
(
'A'
<=
c
&&
c
<=
'Z'
)
||
(
'0'
<=
c
&&
c
<=
'9'
)
||
c
==
'-'
||
c
==
'.'
);
}
const
char
*
badtagchar
(
const
char
*
tag
)
find
badtagchar
(
const
char
*
tag
)
{
while
(
*
tag
)
if
((
'a'
<=*
tag
&&
*
tag
<=
'z'
)
||
(
'A'
<=*
tag
&&
*
tag
<=
'Z'
)
||
(
'0'
<=*
tag
&&
*
tag
<=
'9'
)
||
*
tag
==
'-'
||
*
tag
==
'.'
)
tag
++
;
if
(
goodtagchar
(
*
tag
))
tag
++
;
else
return
tag
;
return
NULL
;
}
programs/winetest/winetest.h
View file @
ff67da43
...
...
@@ -33,7 +33,8 @@ void *xrealloc (void *op, size_t len);
void
xprintf
(
const
char
*
fmt
,
...);
char
*
vstrmake
(
size_t
*
lenp
,
va_list
ap
);
char
*
strmake
(
size_t
*
lenp
,
...);
const
char
*
badtagchar
(
const
char
*
tag
);
int
goodtagchar
(
char
c
);
const
char
*
findbadtagchar
(
const
char
*
tag
);
int
send_file
(
const
char
*
name
);
...
...
programs/winetest/winetest.rc
View file @
ff67da43
...
...
@@ -29,7 +29,7 @@ CAPTION "No tag supplied"
BEGIN
CTEXT "Please supply a tag for your report. You can use letters, digits, dashes and periods."
IDC_STATIC, 10, 5, 130, 30
EDITTEXT IDC_TAG, 35, 30, 80, 10
EDITTEXT IDC_TAG, 35, 30, 80, 10
, ES_AUTOHSCROLL
DEFPUSHBUTTON "Start", IDOK, 25, 45, 40, 14
PUSHBUTTON "Abort", IDABORT, 85, 45, 40, 14
END
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment