Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
dab63839
Commit
dab63839
authored
Feb 01, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify ConsoleWidth() and implement it for real on Win32
parent
dc31c77a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
23 deletions
+10
-23
src/libvlc-common.c
src/libvlc-common.c
+10
-23
No files found.
src/libvlc-common.c
View file @
dab63839
...
@@ -1868,34 +1868,21 @@ static void PauseConsole( void )
...
@@ -1868,34 +1868,21 @@ static void PauseConsole( void )
*****************************************************************************/
*****************************************************************************/
static
int
ConsoleWidth
(
void
)
static
int
ConsoleWidth
(
void
)
{
{
int
i_width
=
80
;
unsigned
i_width
=
80
;
#ifndef WIN32
#ifndef WIN32
char
buf
[
20
];
FILE
*
file
=
popen
(
"stty size 2>/dev/null"
,
"r"
);
char
*
psz_parser
=
NULL
;
if
(
file
!=
NULL
)
FILE
*
file
=
NULL
;
int
i_ret
;
file
=
popen
(
"stty size 2>/dev/null"
,
"r"
);
if
(
file
)
{
i_ret
=
fread
(
buf
,
1
,
20
,
file
);
if
(
i_ret
>
0
)
{
{
buf
[
19
]
=
'\0'
;
if
(
fscanf
(
file
,
"%*u %u"
,
&
i_width
)
<=
0
)
psz_parser
=
strchr
(
buf
,
' '
);
i_width
=
80
;
if
(
psz_parser
)
{
i_ret
=
atoi
(
psz_parser
+
1
);
if
(
i_ret
>=
80
)
{
i_width
=
i_ret
;
}
}
}
pclose
(
file
);
pclose
(
file
);
}
}
#else
CONSOLE_SCREEN_BUFFER_INFO
buf
;
if
(
GetConsoleScreenBufferInfo
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
&
buf
))
i_width
=
buf
.
dwSize
.
X
;
#endif
#endif
return
i_width
;
return
i_width
;
...
...
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