代码之家  ›  专栏  ›  技术社区  ›  shodanex

转换补丁条级别

  •  4
  • shodanex  · 技术社区  · 17 年前

    Index: stdio-common/_i18n_number.h
    ===================================================================
    --- stdio-common/_i18n_number.h (revision 8348)
    +++ stdio-common/_i18n_number.h (working copy)
    @@ -116,7 +116,7 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T
     #else
    
     static CHAR_T *
    -_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr)
    +_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
     {
       return w;
     }
    

    Index: stdio-common/_i18n_number.h
    ===================================================================
    --- a/stdio-common/_i18n_number.h (revision 8348)
    +++ b/stdio-common/_i18n_number.h (working copy)
    @@ -116,7 +116,7 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T
     #else
    
     static CHAR_T *
    -_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr)
    +_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
     {
       return w;
     }
    
    1 回复  |  直到 17 年前
        1
  •  2
  •   ephemient    17 年前

    简单地转换diff块头中的文件名就足够了。

    sed \
        -e 's!^--- !&a/!' \
        -e 's!^+++ !&b/!' \
        < p0.patch \
        > p1.patch
    

    对于其他补丁修改工具,我建议 patchutils