Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
nexedi
MariaDB
Commits
c7964680
Commit
c7964680
authored
Feb 20, 2007
by
msvensson@pilot.blaudden
Browse files
Options
Browse Files
Download
Plain Diff
Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
parents
cab074cb
c7d138cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
client/mysqltest.c
client/mysqltest.c
+20
-3
No files found.
client/mysqltest.c
View file @
c7964680
...
@@ -2196,7 +2196,7 @@ void do_cat_file(struct st_command *command)
...
@@ -2196,7 +2196,7 @@ void do_cat_file(struct st_command *command)
{
{
int
fd
;
int
fd
;
uint
len
;
uint
len
;
byte
buff
[
512
];
char
buff
[
512
];
static
DYNAMIC_STRING
ds_filename
;
static
DYNAMIC_STRING
ds_filename
;
const
struct
command_arg
cat_file_args
[]
=
{
const
struct
command_arg
cat_file_args
[]
=
{
"filename"
,
ARG_STRING
,
TRUE
,
&
ds_filename
,
"File to read from"
"filename"
,
ARG_STRING
,
TRUE
,
&
ds_filename
,
"File to read from"
...
@@ -2213,10 +2213,27 @@ void do_cat_file(struct st_command *command)
...
@@ -2213,10 +2213,27 @@ void do_cat_file(struct st_command *command)
if
((
fd
=
my_open
(
ds_filename
.
str
,
O_RDONLY
,
MYF
(
0
)))
<
0
)
if
((
fd
=
my_open
(
ds_filename
.
str
,
O_RDONLY
,
MYF
(
0
)))
<
0
)
die
(
"Failed to open file %s"
,
ds_filename
.
str
);
die
(
"Failed to open file %s"
,
ds_filename
.
str
);
while
((
len
=
my_read
(
fd
,
&
buff
,
while
((
len
=
my_read
(
fd
,
(
byte
*
)
&
buff
,
sizeof
(
buff
),
MYF
(
0
)))
>
0
)
sizeof
(
buff
),
MYF
(
0
)))
>
0
)
{
{
dynstr_append_mem
(
&
ds_res
,
buff
,
len
);
char
*
p
=
buff
,
*
start
=
buff
;
while
(
p
<
buff
+
len
)
{
/* Convert cr/lf to lf */
if
(
*
p
==
'\r'
&&
*
(
p
+
1
)
&&
*
(
p
+
1
)
==
'\n'
)
{
/* Add fake newline instead of cr and output the line */
*
p
=
'\n'
;
p
++
;
/* Step past the "fake" newline */
dynstr_append_mem
(
&
ds_res
,
start
,
p
-
start
);
p
++
;
/* Step past the "fake" newline */
start
=
p
;
}
else
p
++
;
}
/* Output any chars that migh be left */
dynstr_append_mem
(
&
ds_res
,
start
,
p
-
start
);
}
}
my_close
(
fd
,
MYF
(
0
));
my_close
(
fd
,
MYF
(
0
));
dynstr_free
(
&
ds_filename
);
dynstr_free
(
&
ds_filename
);
...
...
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