1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 91_trim-fix.dpatch by Tobias Grimm <tg@e-tobi.net>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Solution from CVS for bug #178
6 ## DP: ( http://vdr-developer.org/mantisbt/view.php?id=178 )
9 diff -urNad vdr-plugin-burn-0.1
.0~pre21~
/common.c vdr-plugin-burn-0.1
.0~pre21
/common.c
10 --- vdr-plugin-burn-0.1
.0~pre21~
/common.c
2006-09-16 20:33:36.000000000 +0200
11 +++ vdr-plugin-burn-0.1
.0~pre21
/common.c
2006-10-31 16:57:55.000000000 +0100
13 * See the files COPYING and README
for copyright information and how to reach
16 - * $Id: common.c
,v
1.28 2006/09/16 18:33:36 lordjaxom Exp $
17 + * $Id: common.c
,v
1.29 2006/10/01 21:22:27 lordjaxom Exp $
25 - void trim_left
( std
::string
& text_
, const char
* characters_
)
26 + void trim_left
( std
::string
& text_
, const char
* characters_
, std
::string
::size_type offset_
)
28 - std
::string
::size_type pos
= 0;
30 - while ( strchr
( characters_
, text_
[ pos
] ) != NULL
)
31 - text_.erase
( 0, 1 );
32 - if ( ( pos
= text_.
find( '~' ) ) != std
::string
::npos
)
34 - } while ( pos
!= std
::string
::npos
);
35 + std
::string
::size_type pos
;
36 + if ( ( pos
= text_.find_first_not_of
( characters_
, offset_
) ) > 0 )
37 + text_.erase
( offset_
, pos
- offset_
);
40 string get_recording_datetime
(const cRecording
* recording_
, char delimiter
)
41 diff -urNad vdr-plugin-burn-0.1
.0~pre21~
/common.h vdr-plugin-burn-0.1
.0~pre21
/common.h
42 --- vdr-plugin-burn-0.1
.0~pre21~
/common.h
2006-09-16 20:33:36.000000000 +0200
43 +++ vdr-plugin-burn-0.1
.0~pre21
/common.h
2006-10-31 16:57:55.000000000 +0100
45 * See the files COPYING and README
for copyright information and how to reach
48 - * $Id: common.h
,v
1.28 2006/09/16 18:33:36 lordjaxom Exp $
49 + * $Id: common.h
,v
1.29 2006/10/01 21:22:27 lordjaxom Exp $
52 #ifndef VDR_BURN_COMMON_H
55 int ScanPageCount
(const std
::string
& Path
);
56 std
::string progress_bar
(double current
, double total
, int length
= 20);
57 - void trim_left
( std
::string
& text_
, const char
* characters_
);
58 + void trim_left
( std
::string
& text_
, const char
* characters_
, std
::string
::size_type offset_
= 0 );
60 //!--- recording helper functions
-----------------------------------------
62 diff -urNad vdr-plugin-burn-0.1
.0~pre21~
/jobs.c vdr-plugin-burn-0.1
.0~pre21
/jobs.c
63 --- vdr-plugin-burn-0.1
.0~pre21~
/jobs.c
2006-09-16 20:33:36.000000000 +0200
64 +++ vdr-plugin-burn-0.1
.0~pre21
/jobs.c
2006-10-31 16:57:55.000000000 +0100
66 * See the files COPYING and README
for copyright information and how to reach
69 - * $Id: jobs.c
,v
1.34 2006/09/16 18:33:36 lordjaxom Exp $
70 + * $Id: jobs.c
,v
1.35 2006/10/01 21:22:27 lordjaxom Exp $
75 m_fileName
( recording_-
>FileName
() ),
76 m_summary
( get_recording_description
(recording_
) ),
77 m_datetime
( get_recording_datetime
(recording_
, ' ') ),
78 + m_title
( recording_-
>Name
() ),
82 - string title
= recording_-
>Name
();
83 - string
::size_type pos
;
84 - if (global_setup
().RemovePath
&& (pos
= title.rfind
('~')) != string
::npos
)
85 - title.erase
(0, pos
+ 1);
86 - trim_left
(title
, "%@");
88 + std
::string
::size_type pos
;
89 + if ( global_setup
().RemovePath
&& ( pos
= m_title.rfind
( '~' ) ) != std
::string
::npos
)
90 + m_title.erase
( 0, pos
+ 1 );
92 + for ( pos
= 0;; ++pos
) {
93 + trim_left
( m_title
, "%@", pos
);
94 + if ( ( pos
= m_title.
find( '~', pos
) ) == std
::string
::npos
)
99 // size_pair
::size_type recording
::get_total_size
() const